diff options
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | bin/wikitrans | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | wikitrans/wiki2html.py | 6 | ||||
-rw-r--r-- | wikitrans/wikimarkup.py | 2 |
5 files changed, 8 insertions, 6 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index aa894f9..ebebda8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,5 @@ +v1.3, 2018-09-01 -- Don't throw exception on invalid tokens. + Fix python 3 compatibility v1.2, 2018-08-27 -- Fix handling of unrecognized closing tags. v1.1, 2018-08-24 -- Initialize token_class dynamically. v1.0, 2018-08-19 -- Initial release. diff --git a/bin/wikitrans b/bin/wikitrans index 09ba0b3..01c3f9c 100755 --- a/bin/wikitrans +++ b/bin/wikitrans @@ -102,13 +102,13 @@ def getwiki(url, options): options.itype = 'wiktionary' options.kwdict['text'] = text.text.encode() def main(): usage = '%prog [OPTIONS] ARG' - version = '%prog 1.2' + version = '%prog 1.3' description = """Translates MediaWiki documents markup to various other formats. If ARG looks like a URL, the wiki text to be converted will be downloaded from that URL. Otherwise, if --base-url is given, ARG is treated as the name of the page to get from the WikiMedia istallation at that URL. Otherwise, ARG is name of the file to read wiki material from. @@ -19,13 +19,13 @@ from setuptools import setup, find_packages from codecs import open with open("README.rst", "r") as fh: long_description = fh.read() setup(name='wikitrans', - version='1.2', + version='1.3', author='Sergey Poznyakoff', author_email='gray@gnu.org', url='http://www.gnu.org.ua/projects/wikitrans', packages = find_packages(exclude=['contrib', 'docs', 'tests', 'testdata']), scripts=['bin/wikitrans'], diff --git a/wikitrans/wiki2html.py b/wikitrans/wiki2html.py index 0696dce..affe10b 100644 --- a/wikitrans/wiki2html.py +++ b/wikitrans/wiki2html.py @@ -1,9 +1,9 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright (C) 2008-2018 Sergey Poznyakoff +# Copyright (C) 2008-2021 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. # @@ -174,15 +174,15 @@ class HtmlTagNode(WikiTagNode): 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() + + '%s' + '</span>' - + '</li>\n') % (n, n) + + '</li>\n') % (n, n, ref.content.format()) s += '</ol>\n</div>\n' return s else: s = '<' + self.tag if self.args: s += ' ' + str(self.args) diff --git a/wikitrans/wikimarkup.py b/wikitrans/wikimarkup.py index 1e2429f..6660808 100644 --- a/wikitrans/wikimarkup.py +++ b/wikitrans/wikimarkup.py @@ -656,13 +656,13 @@ class WikiMarkupParser(object): if tok: seq.append(tok) else: self.dprint(80, "LEAVE parse_ref=None") return None elif tok.type == 'OTAG': - list.append(self.parse_tag(tok)) + seq.append(self.parse_tag(tok)) else: seq.append(tok) ret = self._new_node(type='REF', ref=ref, content=self._new_node(type='SEQ', content=seq)) self.dprint(80, "LEAVE parse_ref= %s", ret) |