aboutsummaryrefslogtreecommitdiff
path: root/wiki2html.py
diff options
context:
space:
mode:
Diffstat (limited to 'wiki2html.py')
-rw-r--r--wiki2html.py28
1 files changed, 12 insertions, 16 deletions
diff --git a/wiki2html.py b/wiki2html.py
index 441bc76..66939c4 100644
--- a/wiki2html.py
+++ b/wiki2html.py
@@ -174,21 +174,17 @@ class HtmlWikiMarkup (WikiMarkup):
- supported_tags = [ 'nowiki', 'code' ]
- def input_tag(self, tag):
- return tag['tag'] in self.supported_tags
-
def str_tag(self, elt):
if elt['tag'] == 'nowiki':
- return '<pre>' + elt['content'] + '</pre>'
+ return '<pre>' + self.format(elt['content']) + '</pre>'
elif elt['tag'] == 'code':
- kwdict = {
- 'nested': self.nested + 1,
- 'lang': self.lang,
- 'text': elt['content'],
- 'html_base': self.html_base,
- 'image_base': self.image_base,
- 'media_base': self.media_base }
- markup = HtmlWiktionaryMarkup(**kwdict)
- markup.debug_level = self.debug_level
- markup.parse()
- return '<pre><code>' + str(markup) + '</code></pre>' #FIXME
+ self.nested += 1
+ s = self.format(elt['content'])
+ self.nested -= 1
+ return '<pre><code>' + s + '</code></pre>' #FIXME
+ else:
+ s = '<' + elt['tag']
+ if elt['args']:
+ s += ' ' + elt['args']
+ s += '>'
+ s += self.format(elt['content'])
+ return s + '</' + elt['tag'] + '>'

Return to:

Send suggestions and report system problems to the System administrator.