diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e350953..b1e1e3f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.8' - uses: pre-commit/action@v2.0.0 tests: @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [pypy-3.6, 3.6, 3.7, 3.8, 3.9] + python-version: ['pypy-3.6', '3.6', '3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 @@ -45,9 +45,9 @@ jobs: pip install .[testing,linkify] - name: Run pytest run: | - pytest --cov=markdown_it --cov-report=xml --cov-report=term-missing + pytest tests/ --cov=markdown_it --cov-report=xml --cov-report=term-missing - name: Upload to Codecov - if: matrix.python-version == 3.7 && github.repository == 'executablebooks/markdown-it-py' + if: matrix.python-version == '3.7' && github.repository == 'executablebooks/markdown-it-py' uses: codecov/codecov-action@v1 with: name: markdown-it-py-pytests-py3.7 @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: ['3.8'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -87,7 +87,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.8' - name: Install tox run: | @@ -116,7 +116,7 @@ jobs: - name: Set up Python 3.7 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.7' - name: Build package run: | pip install wheel diff --git a/markdown_it/ruler.py b/markdown_it/ruler.py index 9f40fbb7..997c95dc 100644 --- a/markdown_it/ruler.py +++ b/markdown_it/ruler.py @@ -103,7 +103,7 @@ def __compile__(self) -> None: def at(self, ruleName: str, fn: RuleFunc, options=None): """Replace rule by name with new function & options. - :param name: rule name to replace. + :param ruleName: rule name to replace. :param fn: new rule function. :param options: new rule options (not mandatory). :raises: KeyError if name not found @@ -135,8 +135,8 @@ def before(self, beforeName: str, ruleName: str, fn: RuleFunc, options=None): def after(self, afterName: str, ruleName: str, fn: RuleFunc, options=None): """Add new rule to chain after one with given name. - :param beforeName: new rule will be added before this one. - :param ruleName: new rule will be added before this one. + :param afterName: new rule will be added after this one. + :param ruleName: new rule will be added after this one. :param fn: new rule function. :param options: new rule options (not mandatory). :raises: KeyError if name not found @@ -153,7 +153,7 @@ def after(self, afterName: str, ruleName: str, fn: RuleFunc, options=None): def push(self, ruleName: str, fn: RuleFunc, options=None): """Push new rule to the end of chain. - :param ruleName: new rule will be added before this one. + :param ruleName: new rule will be added to the end of chain. :param fn: new rule function. :param options: new rule options (not mandatory). diff --git a/setup.cfg b/setup.cfg index f7647166..de38dd95 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Libraries :: Python Modules @@ -61,11 +62,13 @@ rtd = sphinx_book_theme testing = coverage - psutil - pytest>=3.6,<4 - pytest-benchmark~=3.2 + pytest pytest-cov pytest-regressions +benchmarking = + psutil + pytest + pytest-benchmark~=3.2 [options.packages.find] exclude = diff --git a/tests/test_port/fixtures/normalize.md b/tests/test_port/fixtures/normalize.md index 0020e16d..4a005089 100644 --- a/tests/test_port/fixtures/normalize.md +++ b/tests/test_port/fixtures/normalize.md @@ -29,3 +29,11 @@ Don't encode domains in unknown schemas: .

. + + +Square brackets are allowed +. +[foo](https://bar]baz.org) +. +

foo

+. diff --git a/tests/test_port/test_fixtures.py b/tests/test_port/test_fixtures.py index 4e0c94d5..5e94a149 100644 --- a/tests/test_port/test_fixtures.py +++ b/tests/test_port/test_fixtures.py @@ -84,7 +84,10 @@ def test_commonmark_extras(line, title, input, expected): read_fixture_file(FIXTURE_PATH.joinpath("normalize.md")), ) def test_normalize_url(line, title, input, expected): - if "Keep %25" in title: + if title in { + "Keep %25 as is because decoding it may break urls, #720", + "Square brackets are allowed", + }: # TODO fix failing url escaping test pytest.xfail("url normalisation") md = MarkdownIt("commonmark") diff --git a/tox.ini b/tox.ini index 8b85b395..ff57b2a2 100644 --- a/tox.ini +++ b/tox.ini @@ -9,13 +9,13 @@ envlist = py37 [testenv] usedevelop = true -[testenv:py{36,37,38,39}] +[testenv:py{36,37,38,39,310}] extras = linkify testing -commands = pytest {posargs} +commands = pytest tests/ {posargs} -[testenv:py{36,37,38,39}-plugins] +[testenv:py{36,37,38,39,310}-plugins] extras = testing changedir = {envtmpdir} allowlist_externals = @@ -28,11 +28,11 @@ commands = pytest {posargs} [testenv:py{36,37,38,39}-bench-core] -extras = testing +extras = benchmarking commands = pytest benchmarking/bench_core.py {posargs} [testenv:py{36,37,38}-bench-packages] -extras = testing,compare +extras = benchmarking,compare commands = pytest benchmarking/bench_packages.py {posargs} [testenv:docs-{update,clean}]