#991917 python3-wikitrans: Wiki 2 html conversion errors

Package:
python3-wikitrans
Source:
wikitrans
Submitter:
Erich Schubert
Date:
2021-08-09 09:00:03 UTC
Severity:
important
Tags:
#991917#5
Date:
2021-08-05 11:51:43 UTC
From:
To:
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.

#991917#10
Date:
2021-08-06 11:41:36 UTC
From:
To:
Hi Erich,

Thanks for your report.

Sure.  It will be included when new version is released.

That's definitely a copy-paste error.  I've pushed the following patch
https://git.gnu.org.ua/wikitrans.git/commit/?id=90a9ed7108e45fa8c2d0300e1308a99171240255

Can you give more detail, please?

Regards,
Sergey

#991917#15
Date:
2021-08-06 11:41:36 UTC
From:
To:
Hi Erich,

Thanks for your report.

Sure.  It will be included when new version is released.

That's definitely a copy-paste error.  I've pushed the following patch
https://git.gnu.org.ua/wikitrans.git/commit/?id=90a9ed7108e45fa8c2d0300e1308a99171240255

Can you give more detail, please?

Regards,
Sergey

#991917#20
Date:
2021-08-09 08:56:52 UTC
From:
To:
Hi,

I believe this article causes the problem:

https://simpsons.fandom.com/wiki/John_Swartzwelder?action=edit

It may be because of seemingly mismatched quotes:

''The Simpsons''' 16th season

which is rendered (supposedly correct) as: "/The Simpsons'/ 16th season"

Regards,
Erich