Unfortunately, the wikitrans package fails to convert wiki to html quite
often.
Here are some errors I noticed when processing the Simpsons fandom wiki:
1. This upstream patch should be included in the package:
https://git.gnu.org.ua/wikitrans.git/commit/?id=c785e3ad767b12a13ae75a3513ec88a4d1144210
2. A wrong variable name is used here:
File "/usr/lib/python3/dist-packages/wikitrans/wikimarkup.py", line 662, in
parse_ref
list.append(self.parse_tag(tok))
TypeError: descriptor 'append' for 'list' objects doesn't apply to a
'HtmlTagNode' object
Here, `list` is the standard class, the instance apparently was renamed to
`seq` in some places. Looks like a copy and paste error to me, as in other
location the local variable is named `list`.
https://git.gnu.org.ua/wikitrans.git/tree/wikitrans/wikimarkup.py?id=c785e3ad767b12a13ae75a3513ec88a4d1144210#n662
3. WikiDelimNodes (generated by wikimarkup: ''Example'') cause raw JSON
to be
inserted in the HTML:
{"content": "''", "type": "DELIM", "wikinode": "WikiDelimNode"}
A simple workaround (but not a proper solution) is to override the __str__
method as follows:
wikitrans.wiki2html.WikiDelimNode.__str__ = lambda self: ""
Alternatively, one could return `self.content`, but a proper solution
would be
to generate opening and closing em and bold tags I guess; but I am only
interested in the text, so this hotfix works for me.