diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..051e06b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,41 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: "/" + schedule: + interval: daily + time: "13:00" + open-pull-requests-limit: 10 + ignore: + - dependency-name: hypothesis + versions: + - ">= 5.a, < 6" + - dependency-name: hypothesis + versions: + - 6.0.4 + - 6.1.0 + - 6.1.1 + - 6.10.0 + - 6.2.0 + - 6.3.0 + - 6.3.1 + - 6.3.2 + - 6.3.3 + - 6.3.4 + - 6.4.0 + - 6.4.3 + - 6.6.0 + - 6.6.1 + - 6.7.0 + - 6.8.0 + - 6.8.1 + - 6.8.3 + - 6.8.4 + - 6.8.5 + - 6.8.8 + - 6.8.9 + - 6.9.1 + - 6.9.2 + - dependency-name: flake8 + versions: + - 3.9.0 diff --git a/.pyup.yml b/.pyup.yml deleted file mode 100644 index adacadb..0000000 --- a/.pyup.yml +++ /dev/null @@ -1,4 +0,0 @@ -requirements: - - test_reqs.txt: - update: all - pin: True diff --git a/.travis.yml b/.travis.yml index 96d6548..beadb09 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ language: python -dist: xenial +dist: bionic python: - "2.7" - - "3.4" - "3.5" - "3.6" - "3.7" + - "3.8" install: - python setup.py install - pip install -r test_reqs.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cfd38e..78a9200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -## x.y.z (unreleased) +## 0.9.2 (2026-05-28) +- Deprecate package. Use markdown-it-py instead. +- Remove testing on python 3.4. ## 0.9.1 (2019-10-04) - commonmark.py now requires `future >= 0.14.0` on Python 2, for uniform `builtins` imports in Python 2/3 diff --git a/README.rst b/README.rst index 68c4a61..f3aeff3 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,20 @@ commonmark.py ============= +|No Maintenance Intended| + +**Warning:** commonmark.py is now deprecated. We recommend using `markdown-it-py`_ +for a commonmark parser going forward. See `this issue`_ for background +and discussion. + +-- + +.. _markdown-it-py: https://github.com/executablebooks/markdown-it-py +.. _this issue: https://github.com/readthedocs/commonmark.py/issues/308 + +.. |No Maintenance Intended| image:: http://unmaintained.tech/badge.svg + :target: http://unmaintained.tech/ + commonmark.py is a pure Python port of `jgm `__'s `commonmark.js `__, a Markdown parser and renderer for the @@ -10,9 +24,9 @@ stable we will release the first ``1.0`` version and attempt to keep up to date with changes in ``commonmark.js``. commonmark.py is tested against the CommonMark spec with Python versions -2.7, 3.4, 3.5, 3.6, and 3.7. +2.7, 3.5, 3.6, 3.7, and 3.8. -**Current version:** 0.9.1 +**Current version:** 0.9.2 |Pypi Link| |Build Status| |Doc Link| @@ -124,7 +138,6 @@ Authors - `Bibek Kafle `__ - `Roland Shoemaker `__ -- `Nikolas Nyby `__ .. |Pypi Link| image:: https://img.shields.io/pypi/v/commonmark.svg :target: https://pypi.org/project/commonmark/ diff --git a/commonmark/common.py b/commonmark/common.py index b15a8b6..05b52a1 100644 --- a/commonmark/common.py +++ b/commonmark/common.py @@ -67,7 +67,7 @@ def unescape_string(s): def normalize_uri(uri): try: - return quote(uri.encode('utf-8'), safe=str('/@:+?=&()%#*,')) + return quote(uri.encode('utf-8'), safe=str(';/@:+?=&()%#*,')) except UnicodeDecodeError: # Python 2 also throws a UnicodeDecodeError, complaining about # the width of the "safe" string. Removing this parameter diff --git a/commonmark/inlines.py b/commonmark/inlines.py index 88a84cf..0aa50d3 100644 --- a/commonmark/inlines.py +++ b/commonmark/inlines.py @@ -875,8 +875,6 @@ def parseInlines(self, block): self.brackets = None while (self.parseInline(block)): pass - # allow raw string to be garbage collected - block.string_content = None self.processEmphasis(None) parse = parseInlines diff --git a/commonmark/render/rst.py b/commonmark/render/rst.py index a18f7b2..45adca3 100644 --- a/commonmark/render/rst.py +++ b/commonmark/render/rst.py @@ -119,11 +119,13 @@ def list(self, node, entering): self.cr() def item(self, node, entering): - tagname = '*' if node.list_data['type'] == 'bullet' else '#.' + tagname = '* ' if node.list_data['type'] == 'bullet' else '#. ' if entering: - self.out(tagname + ' ') + self.out(tagname) + self.indent_length += len(tagname) else: + self.indent_length -= len(tagname) self.cr() def block_quote(self, node, entering): diff --git a/commonmark/tests/rst_tests.py b/commonmark/tests/rst_tests.py index b8fa890..22aef08 100644 --- a/commonmark/tests/rst_tests.py +++ b/commonmark/tests/rst_tests.py @@ -97,6 +97,24 @@ def test_ordered_list(self): #. One #. Two #. Three +""" + self.assertEqualRender(src_markdown, expected_rst) + + def test_ordered_list_with_multi_line_items(self): + src_markdown = """ +This is an ordered list with multi-line items: +1. First item, +with lazy indentation. +2. Second item, + with normal indentation. +""" + expected_rst = """ +This is an ordered list with multi-line items: + +#. First item, + with lazy indentation. +#. Second item, + with normal indentation. """ self.assertEqualRender(src_markdown, expected_rst) diff --git a/docs/conf.py b/docs/conf.py index f7f4065..b8b4f9f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -51,17 +51,17 @@ # General information about the project. project = 'commonmark.py' -copyright = '2014-2019, Roland Shoemaker, Bibek Kafle, Nik Nyby' -author = 'Roland Shoemaker, Bibek Kafle, Nik Nyby' +copyright = '2014-2019, Roland Shoemaker, Bibek Kafle' +author = 'Roland Shoemaker, Bibek Kafle' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.9.1' +version = '0.9.2' # The full version, including alpha/beta/rc tags. -release = '0.9.1' +release = '0.9.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.py b/setup.py index 71ac8bc..64a465e 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,8 @@ def run(self): tests_require = [ - 'flake8==3.7.8', - 'hypothesis==3.55.3', + 'flake8==3.9.2', + 'hypothesis==4.24.4', ] @@ -34,7 +34,7 @@ def run(self): setup( name="commonmark", packages=find_packages(exclude=['tests']), - version="0.9.1", + version="0.9.2", license="BSD-3-Clause", description="Python parser for the CommonMark Markdown spec", long_description=long_description, @@ -42,8 +42,6 @@ def run(self): author="Bibek Kafle , " + "Roland Shoemaker ", author_email="rolandshoemaker@gmail.com", - maintainer="Nikolas Nyby", - maintainer_email="nikolas@gnu.org", url="https://github.com/rtfd/commonmark.py", keywords=["markup", "markdown", "commonmark"], entry_points={ diff --git a/test_reqs.txt b/test_reqs.txt index b939813..fba1d9e 100644 --- a/test_reqs.txt +++ b/test_reqs.txt @@ -1,2 +1,2 @@ -flake8==3.7.8 -hypothesis==3.8.3 +flake8==3.9.2 +hypothesis==4.24.4 diff --git a/tox.ini b/tox.ini index 4c550fb..5c1a437 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py{26,27,33,34,35,36,37,py,py3} +envlist = py{26,27,33,34,35,36,37,38,py,py3} [testenv] deps = .[test]