Skip to content

Commit ebd514f

Browse files
authored
Merge branch 'master' into add-url-xfail
2 parents 4c9ccd6 + facd548 commit ebd514f

File tree

15 files changed

+7076
-6909
lines changed

15 files changed

+7076
-6909
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ jobs:
2323
- name: Set up Python 3.8
2424
uses: actions/setup-python@v2
2525
with:
26-
python-version: 3.8
26+
python-version: '3.8'
2727
- uses: pre-commit/[email protected]
2828

2929
tests:
3030

3131
runs-on: ubuntu-latest
3232
strategy:
3333
matrix:
34-
python-version: [pypy-3.6, 3.6, 3.7, 3.8, 3.9]
34+
python-version: ['pypy-3.6', '3.6', '3.7', '3.8', '3.9', '3.10']
3535

3636
steps:
3737
- uses: actions/checkout@v2
@@ -45,9 +45,9 @@ jobs:
4545
pip install .[testing,linkify]
4646
- name: Run pytest
4747
run: |
48-
pytest --cov=markdown_it --cov-report=xml --cov-report=term-missing
48+
pytest tests/ --cov=markdown_it --cov-report=xml --cov-report=term-missing
4949
- name: Upload to Codecov
50-
if: matrix.python-version == 3.7 && github.repository == 'executablebooks/markdown-it-py'
50+
if: matrix.python-version == '3.7' && github.repository == 'executablebooks/markdown-it-py'
5151
uses: codecov/codecov-action@v1
5252
with:
5353
name: markdown-it-py-pytests-py3.7
@@ -60,7 +60,7 @@ jobs:
6060
runs-on: ubuntu-latest
6161
strategy:
6262
matrix:
63-
python-version: [3.8]
63+
python-version: ['3.8']
6464
steps:
6565
- uses: actions/checkout@v2
6666
- name: Set up Python ${{ matrix.python-version }}
@@ -87,7 +87,7 @@ jobs:
8787
- name: Set up Python 3.8
8888
uses: actions/setup-python@v2
8989
with:
90-
python-version: 3.8
90+
python-version: '3.8'
9191

9292
- name: Install tox
9393
run: |
@@ -116,7 +116,7 @@ jobs:
116116
- name: Set up Python 3.7
117117
uses: actions/setup-python@v2
118118
with:
119-
python-version: 3.7
119+
python-version: '3.7'
120120
- name: Build package
121121
run: |
122122
pip install wheel

markdown_it/port.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
- package: markdown-it/markdown-it
2-
version: 12.0.6
3-
commit: df4607f1d4d4be7fdc32e71c04109aea8cc373fa
4-
date: Apr 16, 2021
2+
version: 12.1.0
3+
commit: 13cdeb95abccc78a5ce17acf9f6e8cf5b9ce713b
4+
date: Jul 1, 2021
55
notes:
66
- Rename variables that use python built-in names, e.g.
77
- `max` -> `maximum`

markdown_it/ruler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def __compile__(self) -> None:
103103
def at(self, ruleName: str, fn: RuleFunc, options=None):
104104
"""Replace rule by name with new function & options.
105105
106-
:param name: rule name to replace.
106+
:param ruleName: rule name to replace.
107107
:param fn: new rule function.
108108
:param options: new rule options (not mandatory).
109109
:raises: KeyError if name not found
@@ -135,8 +135,8 @@ def before(self, beforeName: str, ruleName: str, fn: RuleFunc, options=None):
135135
def after(self, afterName: str, ruleName: str, fn: RuleFunc, options=None):
136136
"""Add new rule to chain after one with given name.
137137
138-
:param beforeName: new rule will be added before this one.
139-
:param ruleName: new rule will be added before this one.
138+
:param afterName: new rule will be added after this one.
139+
:param ruleName: new rule will be added after this one.
140140
:param fn: new rule function.
141141
:param options: new rule options (not mandatory).
142142
:raises: KeyError if name not found
@@ -153,7 +153,7 @@ def after(self, afterName: str, ruleName: str, fn: RuleFunc, options=None):
153153
def push(self, ruleName: str, fn: RuleFunc, options=None):
154154
"""Push new rule to the end of chain.
155155
156-
:param ruleName: new rule will be added before this one.
156+
:param ruleName: new rule will be added to the end of chain.
157157
:param fn: new rule function.
158158
:param options: new rule options (not mandatory).
159159

markdown_it/rules_block/html_block.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# last argument defines whether it can terminate a paragraph or not
1414
HTML_SEQUENCES: List[Tuple[Pattern, Pattern, bool]] = [
1515
(
16-
re.compile(r"^<(script|pre|style)(?=(\s|>|$))", re.IGNORECASE),
17-
re.compile(r"<\/(script|pre|style)>", re.IGNORECASE),
16+
re.compile(r"^<(script|pre|style|textarea)(?=(\s|>|$))", re.IGNORECASE),
17+
re.compile(r"<\/(script|pre|style|textarea)>", re.IGNORECASE),
1818
True,
1919
),
2020
(re.compile(r"^<!--"), re.compile(r"-->"), True),

markdown_it/rules_inline/balance_pairs.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ def processDelimiters(state: StateInline, delimiters, *args):
2323
continue
2424

2525
# Previously calculated lower bounds (previous fails)
26-
# for each marker and each delimiter length modulo 3.
26+
# for each marker, each delimiter length modulo 3,
27+
# and for whether this closer can be an opener;
28+
# https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460
2729
if closer.marker not in openersBottom:
28-
openersBottom[closer.marker] = [-1, -1, -1]
30+
openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]
2931

30-
minOpenerIdx = openersBottom[closer.marker][closer.length % 3]
32+
minOpenerIdx = openersBottom[closer.marker][
33+
(3 if closer.open else 0) + (closer.length % 3)
34+
]
3135

3236
openerIdx = closerIdx - closer.jump - 1
3337

@@ -89,7 +93,9 @@ def processDelimiters(state: StateInline, delimiters, *args):
8993
# See details here:
9094
# https:#github.com/commonmark/cmark/issues/178#issuecomment-270417442
9195
#
92-
openersBottom[closer.marker][(closer.length or 0) % 3] = newMinOpenerIdx
96+
openersBottom[closer.marker][
97+
(3 if closer.open else 0) + ((closer.length or 0) % 3)
98+
] = newMinOpenerIdx
9399

94100
closerIdx += 1
95101

setup.cfg

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ classifiers =
1818
Programming Language :: Python :: 3.7
1919
Programming Language :: Python :: 3.8
2020
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: 3.10
2122
Programming Language :: Python :: Implementation :: CPython
2223
Programming Language :: Python :: Implementation :: PyPy
2324
Topic :: Software Development :: Libraries :: Python Modules
@@ -61,11 +62,13 @@ rtd =
6162
sphinx_book_theme
6263
testing =
6364
coverage
64-
psutil
65-
pytest>=3.6,<4
66-
pytest-benchmark~=3.2
65+
pytest
6766
pytest-cov
6867
pytest-regressions
68+
benchmarking =
69+
psutil
70+
pytest
71+
pytest-benchmark~=3.2
6972

7073
[options.packages.find]
7174
exclude =

0 commit comments

Comments
 (0)