Description

The RST parser fails to create proper conversion of the RST ..figure:: and ..image:: directives. A sting attachment:image.png is created instead of a real attachment link / inline link.

Steps to reproduce

  1. Create an empty page
  2. Change the formating to RST: #FORMAT rst

  3. Add a ..figure:: Images/image.png directive

  4. Save changes
  5. The parser renders a string attachment:image.png instead of a link that can be used to upload a figure on the right page (in this case Images)

Example

The following is properly converted to a link:

[ATTACH]

The following is rendered only as sting:

Component selection

Details

MoinMoin Version

1.6.0

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

This patch seems to fix the problem for me:

--- MoinMoin/parser/text_rst.py.vanilla 2008-01-26 17:03:25.000000000 +0100
+++ MoinMoin/parser/text_rst.py 2008-01-26 01:52:31.000000000 +0100
@@ -408,7 +408,7 @@
                 # Attachment doesn't exist, MoinMoin should process it
                 if prefix == '':
                     prefix = 'attachment:'
-                self.process_wiki_text(prefix + attach_name)
+                self.process_wiki_text('{{%s%s}}' % (prefix,attach_name))
                 self.wiki_text = self.fixup_wiki_formatting(self.wiki_text)
                 self.add_wiki_markup()
             # Attachment exists, get a link to it.

Discussion

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/IncorrectRenderingOfFiguresWithPathsInRstParser (last edited 2008-01-26 18:02:30 by ThomasWaldmann)