diff options
author | Martin Langhoff <martin@laptop.org> | 2010-11-29 16:48:49 (GMT) |
---|---|---|
committer | Martin Langhoff <martin@laptop.org> | 2010-11-29 16:48:49 (GMT) |
commit | ae4209017bb67643140fb2a35026d2ab68eee57c (patch) | |
tree | 41f38d326cd20a1cb9d83b91be3f2c99b80887ca | |
parent | 6ae891c67df08b3094359ce754cda497b93f1798 (diff) |
expander: Now resilient against empty blocks {{}}
-rwxr-xr-x | mwlib/expander.py | 8 |
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:]) |