summaryrefslogtreecommitdiffabout
path: root/WikiTrans/wiki2html.py
Side-by-side diff
Diffstat (limited to 'WikiTrans/wiki2html.py') (more/less context) (ignore whitespace changes)
-rw-r--r--WikiTrans/wiki2html.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/WikiTrans/wiki2html.py b/WikiTrans/wiki2html.py
index 81b918f..7c71602 100644
--- a/WikiTrans/wiki2html.py
+++ b/WikiTrans/wiki2html.py
@@ -143,6 +143,25 @@ class HtmlTagNode(WikiTagNode):
s = self.content.format()
self.parser.nested -= 1
return '<pre><code>' + s + '</code></pre>' #FIXME
+ elif self.tag == 'ref':
+ n = self.idx+1
+ return '<sup id="cite_ref-%d" class="reference"><a name="cite_ref-%d" href=#cite_note-%d">%d</a></sup>' % (n,n,n,n)
+ elif self.tag == 'references':
+ s = '<div class="references">\n'
+ s += '<ol class="references">\n'
+ n = 0
+ for ref in self.parser.references:
+ n += 1
+ s += ('<li id="cite_note-%d">' + \
+ '<span class="mw-cite-backlink">' + \
+ '<b><a href="#cite_ref-%d">^</a></b>' + \
+ '</span>' + \
+ '<span class="reference-text">' + \
+ ref.content.format() + \
+ '</span>' + \
+ '</li>\n') % (n,n)
+ s += '</ol>\n</div>\n'
+ return s
else:
s = '<' + self.tag
if self.args:
@@ -177,7 +196,7 @@ class HtmlWikiMarkup (WikiMarkup):
"""
nested = 0
-
+ references = []
def __init__(self, *args, **kwargs):
super(HtmlWikiMarkup, self).__init__(*args, **kwargs)
self.token_class['LINK'] = HtmlLinkNode

Return to:

Send suggestions and report system problems to the System administrator.