Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Langhoff <martin@laptop.org>2010-11-29 16:48:49 (GMT)
committer Martin Langhoff <martin@laptop.org>2010-11-29 16:48:49 (GMT)
commitae4209017bb67643140fb2a35026d2ab68eee57c (patch)
tree41f38d326cd20a1cb9d83b91be3f2c99b80887ca
parent6ae891c67df08b3094359ce754cda497b93f1798 (diff)
expander: Now resilient against empty blocks {{}}
-rwxr-xr-xmwlib/expander.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/mwlib/expander.py b/mwlib/expander.py
index e5e4049..867af19 100755
--- a/mwlib/expander.py
+++ b/mwlib/expander.py
@@ -206,6 +206,11 @@ class Parser(object):
# find the name
name = Node()
t.children.append(name)
+
+ # empty blocks are a fact of life
+ if len(children) == 0:
+ return t
+
for idx, c in enumerate(children):
if c==u'|':
break
@@ -430,6 +435,9 @@ class Expander(object):
if name.startswith("[["):
return None
+ if name == '':
+ return ''
+
if name.startswith(":"):
log.info("including article")
raw = self.db.getRawArticle(name[1:])