Description

Describe the bug...

Steps to reproduce

  1. Install moin-1.5.3
  2. Create a new wiki instance from the templates
  3. In WikiSandbox enter

This is a Link

or:

#format rst

MoinWriter instance has no attribute 'head_prefix'

Example

Details

traceback.html

MoinMoin Version

1.5.3

OS and Version

Mac OS X 10.4.6

Python Version

Python 2.4.2

Server Setup

Server Details

Workaround

This issue can be fixed by applying the below patch, or by downgrading to docutils 0.4.

   1 --- rst.orig	2006-05-03 09:23:07.000000000 -0700
   2 +++ rst.py	2006-05-03 09:25:06.000000000 -0700
   3 @@ -165,6 +165,11 @@ class MoinWriter(html4css1.Writer):
   4                                   self)
   5          self.document.walkabout(visitor)
   6          self.visitor = visitor
   7 +        # Docutils 0.5.0 and later require the writer to have the visitor 
   8 +        # attributes.
   9 +        if (hasattr(html4css1.Writer, 'visitor_attributes')):
  10 +            for attr in html4css1.Writer.visitor_attributes:
  11 +                setattr(self, attr, getattr(visitor, attr))
  12          self.output = html_escape_unicode(visitor.astext())
  13  
  14  class Parser:
  15 @@ -189,6 +194,7 @@ class Parser:
  16                  'file_insertion_enabled': 0,
  17                  'raw_enabled': 0,
  18                  'stylesheet_path': '',
  19 +                'template': '',
  20              }
  21          )
  22  
writer_fix.patch

It will be fixed in the next MoinMoin release.

Discussion

Which docutils version are you using?

docutils-snapshot from http://docutils.sourceforge.net/

Plan


CategoryMoinBugFixed

MoinMoin: MoinMoinBugs/ReStructuredTextMoinWriterHasNoheadPrefix (last edited 2007-10-29 19:21:22 by localhost)