Description

Wrong nesting leads to extremely wrong rendering of pages, ALL stuff below the problem does not get rendered at all.

Steps to reproduce

Initially it was observed on page MoinMoinBugs/getPageTextFailsOnSomePres, but below is an easier example (there is much more than you see!).

Example Markup

I added spaces between the curly braces to not trigger problems in the markup display:
{ { {#!python
#    { { { <-- this is wrong, but can happen
} } }

Example Rendering

(fixed now)

   1 #    {{{ <-- this is wrong, but can happen

Component selection

Details

MoinMoin Version

1.6dev, this wiki

Workaround

Don't nest.

Discussion

I am asking myself whether all that nesting code is worth the trouble it is causing. Maybe we should just revert to the "no nesting" 1.5 approach or implement the creole way for it.

I reverted about all of the past nesting and }}} related changes, cleaned up the parser/pre section processing in the wiki parser and introduce a new parser/pre syntax element to make the detection of the end of the section safe. Quoting CHANGES:

    * Nested parser/pre sections should work now, using this syntax:
      a) just use more curly braces if you have 3 closing in your content:
         {{{{
         }}} <- does not terminate the section!
         }}}}
      b) use some magic string:
         {{{somemagicstring
         }}} <- does not terminate the section!
         somemagicstring}}}
      c) {{{whatever#!python
         # py code
         whatever}}}
      Pitfall: stuff like below does not work as it did in 1.5:
         {{{aaa
         bbb}}}
      Solution:
         {{{
         aaa
         bbb
         }}}
      Maybe this can get automatically converted by the mig script (TODO).
    * While fixing the nested parser/pre section, some other related rendering
      bugs were also fixed (e.g. missing blanks after }}}).

Even weird stuff like this works:

this is red, 1st nesting level

this is blue, 2nd nesting level

this is green, 3rd nesting level

this is red, 1st nesting level

this is blue, 2nd nesting level

this is red, 1st nesting level

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.6WrongNesting (last edited 2008-01-21 23:38:06 by ThomasWaldmann)