[dokuwiki] Re: unittest

  • From: Chris Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 09 Aug 2006 11:29:32 +0100

Andreas Gohr wrote:

following wikitext samples:

(( a (( b )) c )) ( can be viewed at http://wiki.jalakai.co.uk/sandbox/test2 )
And does anyone have an idea for how dokuwiki "should" render the

Best would be a footnote with this content: 'a (( b )) c'

(( a ** (( b )) ** c )) ( can be viewed at http://wiki.jalakai.co.uk/sandbox/test3 )

footnote with 'a <b> (( b )) </b> c'
para (( a (( b )) c )) text ( can be viewed at at http://wiki.jalakai.co.uk/sandbox/test4 )

para1) text

with 1) linking to the footnote

However I don't consider them high priority - if you find a solution,
fine - if not, I guess nearly nobody cares ;-)

Awwhhh, I think its a little bigger than that. If you somehow nest a footnote all of your document prior to the outer footnote start will disappear. Footnote rendering saves a copy of the current renderer output, processes the footnote, then restores its copy of the output. A nested footnote will overwrite that saved copy with the outer footnote content to that point.


Anyhow, I found a solution. The footnotes above will all terminate at the first "))" rather than the second one. Invalid HTML can be generated, but the cause should be obvious. Patch to follow maybe with some unittests :)

The footnote problem highlights a couple of (minor) flaws in the lexer.
- while its possible to prevent parent-child nesting of syntax modes, its not possible to prevent grandparent-grandchild nesting.
It would be handy if an entry pattern handler could communicate back - "mode entry not possible, exit immediately".
- characters can match several lookahead patterns, reducing the effectiveness of look aheads for entry patterns.


Cheers,

Chris

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: