[gcompris/gcomprixogoo] Fix for wiktio2xml, now support non closed tad on a line by concatenating the next line.
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] Fix for wiktio2xml, now support non closed tad on a line by concatenating the next line.
- Date: Sat, 25 Sep 2010 00:18:25 +0000 (UTC)
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]