summaryrefslogtreecommitdiff
path: root/WikiTrans/wikitoken.py
diff options
context:
space:
mode:
Diffstat (limited to 'WikiTrans/wikitoken.py')
-rw-r--r--WikiTrans/wikitoken.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/WikiTrans/wikitoken.py b/WikiTrans/wikitoken.py
index 5606ecc..2238a66 100644
--- a/WikiTrans/wikitoken.py
+++ b/WikiTrans/wikitoken.py
@@ -61,6 +61,8 @@ class WikiNode(object):
class WikiContentNode(WikiNode):
content = None
+ def format(self):
+ pass
@jsonencoder
def jsonEncode(self):
ret = {}
@@ -114,13 +116,20 @@ class WikiTagNode(WikiContentNode):
tag = None
isblock = False
args = None
+ idx = None
+ def __init__(self, *args, **keywords):
+ super(WikiTagNode, self).__init__(*args, **keywords)
+ if self.type == 'TAG' and self.tag == 'ref' and hasattr(self.parser,'references'):
+ self.idx = len(self.parser.references)
+ self.parser.references.append(self)
@jsonencoder
def jsonEncode(self):
return {
'tag': self.tag,
'isblock': self.isblock,
'args': self.args.tab if self.args else None,
- 'content': self.content.jsonEncode()
+ 'content': self.content.jsonEncode() if self.content else None,
+ 'idx': self.idx
}
class WikiRefNode(WikiContentNode):

Return to:

Send suggestions and report system problems to the System administrator.