changeset 2762:9b622bb9e7f7

fix wiki parser and converter tests
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 25 Aug 2007 20:34:24 +0200
parents 3a6a25169f55
children 6a707c041132
files MoinMoin/parser/text_moin_wiki.py MoinMoin/script/migration/_tests/test_conv160_wiki.py
diffstat 2 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Sat Aug 25 17:42:25 2007 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Sat Aug 25 20:34:24 2007 +0200
@@ -1160,13 +1160,8 @@
                 self.formatter.in_p) and lastpos < len(line):
             result.append(self.formatter.paragraph(1, css_class="line874"))
         if '}}}' in line and len(line[lastpos:].strip()) > 0:
-            rules = self.formatting_rules.replace('\n', '|')
-            rules = ur'(?P<notword>!%(word_rule)s)|%(rules)s' % {
-                'word_rule': self.word_rule,
-                'rules': rules,
-            }
-            scanning_re = re.compile(rules, re.UNICODE)
-            result.append(self.scan(scanning_re, line[lastpos:].strip(), inhibit_p=inhibit_p))
+            scan_re = re.compile(self.scan_rules, re.UNICODE|re.VERBOSE)
+            result.append(self.scan(scan_re, line[lastpos:].strip(), inhibit_p=inhibit_p))
         else:
             result.append(self.formatter.text(line[lastpos:]))
         return u''.join(result)
--- a/MoinMoin/script/migration/_tests/test_conv160_wiki.py	Sat Aug 25 17:42:25 2007 +0200
+++ b/MoinMoin/script/migration/_tests/test_conv160_wiki.py	Sat Aug 25 20:34:24 2007 +0200
@@ -51,7 +51,7 @@
             ('[wiki:LinuxWiki: LinuxWiki.de]', {}, '[[LinuxWiki:|LinuxWiki.de]]'),
             # does not work in 1.5.8, no need to convert:
             #('[wiki:MacroMarket/EmbedObject EO]', {}, '["MacroMarket/EmbedObject" EO]'),
-            ('[wiki:MoinMoin/FrontPage]', {}, '[[MoinMoin:FrontPage]]'),
+            ('[wiki:MoinMoin/FrontPage]', {}, 'MoinMoin:FrontPage'),
             ('[wiki:/OtherPage]', rename_some_page, '[[/OtherPage]]'),
             ('[wiki:/OtherPage other page]', rename_some_page, '[[/OtherPage|other page]]'),
             ('some_text', {}, 'some_text'),