Skip to content

Commit

Permalink
Merge branch 'master' into fix-code-block-no-newline
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Dec 1, 2021
2 parents 76240fe + 0195be3 commit 2870234
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/tests.yml
Expand Up @@ -23,15 +23,15 @@ 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:

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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions markdown_it/ruler.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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).
Expand Down
9 changes: 6 additions & 3 deletions setup.cfg
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand Down
8 changes: 8 additions & 0 deletions tests/test_port/fixtures/normalize.md
Expand Up @@ -29,3 +29,11 @@ Don't encode domains in unknown schemas:
.
<p><a href="skype:%CE%B3%CE%B3%CE%B3"></a></p>
.


Square brackets are allowed
.
[foo](https://bar]baz.org)
.
<p><a href="https://bar%5Dbaz.org">foo</a></p>
.
5 changes: 4 additions & 1 deletion tests/test_port/test_fixtures.py
Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions tox.ini
Expand Up @@ -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 =
Expand All @@ -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}]
Expand Down

0 comments on commit 2870234

Please sign in to comment.