diff --git a/.travis.yml b/.travis.yml index dab63f1..c9859d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,9 @@ matrix: - python: 3.8 env: TOXENV=py38 dist: xenial + - python: 3.9-dev + env: TOXENV=py39 + dist: xenial - python: pypy env: TOXENV=pypy - env: TOXENV=pep8 diff --git a/readme_renderer/markdown.py b/readme_renderer/markdown.py index 8262339..93ac34a 100644 --- a/readme_renderer/markdown.py +++ b/readme_renderer/markdown.py @@ -19,7 +19,13 @@ import pygments import pygments.lexers import pygments.formatters -from six.moves import html_parser + +try: + from six.moves.html_parser import unescape +except ImportError: # Python 2 + from six.moves import html_parser + + unescape = html_parser.HTMLParser().unescape from .clean import clean @@ -99,7 +105,7 @@ def replacer(match): # translate '"' to '"', but it confuses pygments. Pygments will # escape any html entities when re-writing the code, and we run # everything through bleach after. - code = html_parser.HTMLParser().unescape(code) + code = unescape(code) highlighted = pygments.highlight(code, lexer, formatter) diff --git a/setup.py b/setup.py index 413aa0d..9cde0bd 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,7 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ], diff --git a/tox.ini b/tox.ini index 4717369..1876102 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,pypy,py35,py36,py37,py38,pep8,py2pep8,packaging,noextra +envlist = py27,pypy,py35,py36,py37,py38,py39,pep8,py2pep8,packaging,noextra [testenv] deps =