changeset 3558:44d1cd70e74c

fix usage of WikiParser.word_rule (use re.VERBOSE) - fixes xapian indexing of WikiWords (index "WikiWords", "Wiki" and "Words"), fixes detection of WikiWords for the docbook parser
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 May 2008 02:06:33 +0200
parents 9052c06d4ae3
children 8af17e0d221b
files MoinMoin/parser/text_docbook.py MoinMoin/search/Xapian.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_docbook.py	Mon May 05 22:10:44 2008 +0200
+++ b/MoinMoin/parser/text_docbook.py	Tue May 06 02:06:33 2008 +0200
@@ -123,12 +123,12 @@
         #    if a word is a valid wikiname & a valid wikipage,
         #    replace word with hyperlink
 
-        found = re.finditer(self.wikiParser.word_rule, result)
+        found = re.finditer(self.wikiParser.word_rule, result, re.UNICODE|re.VERBOSE)
         if found:
             splitResult = _splitResult(found, result)
 
             for index in range(len(splitResult)):
-                if (re.match(self.wikiParser.word_rule, splitResult[index])
+                if (re.match(self.wikiParser.word_rule, splitResult[index], re.UNICODE|re.VERBOSE)
                     and Page.Page(self.request, splitResult[index]).exists()):
                     splitResult[index] = self.wikiParser._word_repl(splitResult[index])
             result = ''.join(splitResult)
--- a/MoinMoin/search/Xapian.py	Mon May 05 22:10:44 2008 +0200
+++ b/MoinMoin/search/Xapian.py	Tue May 06 02:06:33 2008 +0200
@@ -75,7 +75,7 @@
                  }
 
     singleword_re = re.compile(singleword, re.U)
-    wikiword_re = re.compile(WikiParser.word_rule, re.U)
+    wikiword_re = re.compile(WikiParser.word_rule, re.UNICODE|re.VERBOSE)
 
     token_re = re.compile(
         r"(?P<company>\w+[&@]\w+)|" + # company names like AT&T and Excite@Home.