Description

Certain markup will trigger exception ("AttributeError: Formatter instance has no attribute 'page'") in MoinMoin/parser/text_moin_wiki.py Line 961. Said markup will also not be rendered correctly (missing space between monospaced text and text in brackets).

Steps to reproduce

  1. create a page in text mode which contains the following markup:
     {{{monospace
    (and text in brackets)}}}
  2. save that page
  3. open that page in GUI editor

Example

Component selection

Details

Stacktrace: see http://paste.pocoo.org/show/2818/

Workaround

edit page in text editor, which does not have this problem. Or do not use the problematic markup. Or apply the following patch (ugly, but seems to remove the problem):

   1 --- moin-1.6.070814-unpatched/lib/python2.5/site-packages/MoinMoin/parser/text_moin_wiki.py	2007-08-14 01:44:13.000000000 +0200
   2 +++ moin-engine/lib/python2.5/site-packages/MoinMoin/parser/text_moin_wiki.py	2007-08-22 17:41:55.000000000 +0200
   3 @@ -957,6 +957,9 @@
   4              strings, outputting verbatim any intervening text.
   5          """
   6          self.formatter = formatter
   7 +        # workaround for http://moinmo.in/MoinMoinBugs/1.6devMarkupCrashesGUIEditor
   8 +        if not hasattr(formatter, 'page'):
   9 +            formatter.page = self.request.page
  10          self.hilite_re = self.formatter.page.hilite_re
  11  
  12          # prepare regex patterns
workaround_gui_editor_bug.diff

This will, however, not remove the rendering problem mentioned above.

Discussion

likely broken by http://hg.moinmo.in/moin/1.6/rev/b15b0248e1fa

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/1.6devMarkupCrashesGUIEditor (last edited 2007-10-29 19:09:01 by localhost)