[gcompris/gcomprixogoo] Fix for wiktio2xml, now support non closed tad on a line by concatenating the next line.



commit 693ebee3c07d10de8294c115918813df0ffbb607
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Fri Sep 24 22:45:45 2010 +0200

    Fix for wiktio2xml, now support non closed tad on a line by concatenating
    the next line.

 tools/wiktio2xml/wiktio2xml.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/tools/wiktio2xml/wiktio2xml.py b/tools/wiktio2xml/wiktio2xml.py
index 0b11186..a9bf269 100755
--- a/tools/wiktio2xml/wiktio2xml.py
+++ b/tools/wiktio2xml/wiktio2xml.py
@@ -250,10 +250,18 @@ class WikiHandler(ContentHandler):
         self.textContent = re.sub(r"<!--[^>]*-->", "",
                                   self.textContent, re.M)
 
+        concat = ""
         for l in self.textContent.splitlines():
-
+            l = concat + l
             next = False
 
+            if re.search(r"<[^>]+$", l):
+                # Wiki uses a trick to format text area by endind in uncomplete
+                # html tags. In this case, we concat this line with the next one
+                # before processing it
+                concat = l
+                continue
+
             for filter in self.filterContent:
                 if re.search(filter, l, re.I):
                     if inDefinition:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]