Skip to content

Commit e0eb8f6

Browse files
committed
py-markdown-it-py: update to 3.0.0.
## 3.0.0 - 2023-06-03 ⚠️ This release contains some minor breaking changes in the internal API and improvements to the parsing strictness. **Full Changelog**: <executablebooks/markdown-it-py@v2.2.0...v3.0.0> ### ⬆️ UPGRADE: Drop support for Python 3.7 Also add testing for Python 3.11 ### ⬆️ UPGRADE: Update from upstream markdown-it `12.2.0` to `13.0.0` A key change is the addition of a new `Token` type, `text_special`, which is used to represent HTML entities and backslash escaped characters. This ensures that (core) typographic transformation rules are not incorrectly applied to these texts. The final core rule is now the new `text_join` rule, which joins adjacent `text`/`text_special` tokens, and so no `text_special` tokens should be present in the final token stream. Any custom typographic rules should be inserted before `text_join`. A new `linkify` rule has also been added to the inline chain, which will linkify full URLs (e.g. `https://example.com`), and fixes collision of emphasis and linkifier (so `http://example.org/foo._bar_-_baz` is now a single link, not emphasized). Emails and fuzzy links are not affected by this. * ♻️ Refactor backslash escape logic, add `text_special` [#276](executablebooks/markdown-it-py#276) * ♻️ Parse entities to `text_special` token [#280](executablebooks/markdown-it-py#280) * ♻️ Refactor: Add linkifier rule to inline chain for full links [#279](executablebooks/markdown-it-py#279) * ‼️ Remove `(p)` => `§` replacement in typographer [#281](executablebooks/markdown-it-py#281) * ‼️ Remove unused `silent` arg in `ParserBlock.tokenize` [#284](executablebooks/markdown-it-py#284) * 🐛 FIX: numeric character reference passing [#272](executablebooks/markdown-it-py#272) * 🐛 Fix: tab preventing paragraph continuation in lists [#274](executablebooks/markdown-it-py#274) * 👌 Improve nested emphasis parsing [#273](executablebooks/markdown-it-py#273) * 👌 fix possible ReDOS in newline rule [#275](executablebooks/markdown-it-py#275) * 👌 Improve performance of `skipSpaces`/`skipChars` [#271](executablebooks/markdown-it-py#271) * 👌 Show text of `text_special` in `tree.pretty` [#282](executablebooks/markdown-it-py#282) ### ♻️ REFACTOR: Replace most character code use with strings The use of `StateBase.srcCharCode` is deprecated (with backward-compatibility), and all core uses are replaced by `StateBase.src`. Conversion of source string characters to an integer representing the Unicode character is prevalent in the upstream JavaScript implementation, to improve performance. However, it is unnecessary in Python and leads to harder to read code and performance deprecations (during the conversion in the `StateBase` initialisation). See [#270](executablebooks/markdown-it-py#270), thanks to [@hukkinj1](https://github.com/hukkinj1). ### ♻️ Centralise indented code block tests For CommonMark, the presence of indented code blocks prevent any other block element from having an indent of greater than 4 spaces. Certain Markdown flavors and derivatives, such as mdx and djot, disable these code blocks though, since it is more common to use code fences and/or arbitrary indenting is desirable. Previously, disabling code blocks did not remove the indent limitation, since most block elements had the 3 space limitation hard-coded. This change centralised the logic of applying this limitation (in `StateBlock.is_code_block`), and only applies it when indented code blocks are enabled. This allows for e.g. ```md <div> <div> I can indent as much as I want here. <div> <div> ``` See [#260](executablebooks/markdown-it-py#260) ### 🔧 Maintenance changes Strict type annotation checking has been applied to the whole code base, [ruff](https://github.com/charliermarsh/ruff) is now used for linting, and fuzzing tests have been added to the CI, to integrate with Google [OSS-Fuzz](https://github.com/google/oss-fuzz/tree/master/projects/markdown-it-py) testing, thanks to [@DavidKorczynski](https://github.com/DavidKorczynski). * 🔧 MAINTAIN: Make type checking strict [#](executablebooks/markdown-it-py#267) * 🔧 Add typing of rule functions [#283](executablebooks/markdown-it-py#283) * 🔧 Move linting from flake8 to ruff [#268](executablebooks/markdown-it-py#268) * 🧪 CI: Add fuzzing workflow for PRs [#262](executablebooks/markdown-it-py#262) * 🔧 Add tox env for fuzz testcase run [#263](executablebooks/markdown-it-py#263) * 🧪 Add OSS-Fuzz set up by @DavidKorczynski in [#255](executablebooks/markdown-it-py#255) * 🧪 Fix fuzzing test failures [#254](executablebooks/markdown-it-py#254)
1 parent 149ab84 commit e0eb8f6

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

textproc/py-markdown-it-py/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# $NetBSD: Makefile,v 1.3 2023/03/05 07:27:37 adam Exp $
1+
# $NetBSD: Makefile,v 1.4 2023/06/06 08:21:18 wiz Exp $
22

3-
DISTNAME= markdown-it-py-2.2.0
3+
DISTNAME= markdown-it-py-3.0.0
44
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
55
CATEGORIES= textproc python
66
MASTER_SITES= ${MASTER_SITE_PYPI:=m/markdown-it-py/}
@@ -15,7 +15,7 @@ DEPENDS+= ${PYPKGPREFIX}-mdurl>=0.1:../../www/py-mdurl
1515

1616
USE_LANGUAGES= # none
1717

18-
PYTHON_VERSIONS_INCOMPATIBLE= 27
18+
PYTHON_VERSIONS_INCOMPATIBLE= 27 37
1919

2020
post-install:
2121
cd ${DESTDIR}${PREFIX}/bin && \

textproc/py-markdown-it-py/PLIST

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
@comment $NetBSD: PLIST,v 1.1 2023/02/20 10:52:16 adam Exp $
1+
@comment $NetBSD: PLIST,v 1.2 2023/06/06 08:21:18 wiz Exp $
22
bin/markdown-it-${PYVERSSUFFIX}
3-
${PYSITELIB}/${WHEEL_INFODIR}/INSTALLER
4-
${PYSITELIB}/${WHEEL_INFODIR}/LICENSE
5-
${PYSITELIB}/${WHEEL_INFODIR}/LICENSE.markdown-it
6-
${PYSITELIB}/${WHEEL_INFODIR}/METADATA
7-
${PYSITELIB}/${WHEEL_INFODIR}/RECORD
8-
${PYSITELIB}/${WHEEL_INFODIR}/REQUESTED
9-
${PYSITELIB}/${WHEEL_INFODIR}/WHEEL
10-
${PYSITELIB}/${WHEEL_INFODIR}/direct_url.json
11-
${PYSITELIB}/${WHEEL_INFODIR}/entry_points.txt
123
${PYSITELIB}/markdown_it/__init__.py
134
${PYSITELIB}/markdown_it/__init__.pyc
145
${PYSITELIB}/markdown_it/_compat.py
@@ -103,6 +94,8 @@ ${PYSITELIB}/markdown_it/rules_core/smartquotes.py
10394
${PYSITELIB}/markdown_it/rules_core/smartquotes.pyc
10495
${PYSITELIB}/markdown_it/rules_core/state_core.py
10596
${PYSITELIB}/markdown_it/rules_core/state_core.pyc
97+
${PYSITELIB}/markdown_it/rules_core/text_join.py
98+
${PYSITELIB}/markdown_it/rules_core/text_join.pyc
10699
${PYSITELIB}/markdown_it/rules_inline/__init__.py
107100
${PYSITELIB}/markdown_it/rules_inline/__init__.pyc
108101
${PYSITELIB}/markdown_it/rules_inline/autolink.py
@@ -117,12 +110,16 @@ ${PYSITELIB}/markdown_it/rules_inline/entity.py
117110
${PYSITELIB}/markdown_it/rules_inline/entity.pyc
118111
${PYSITELIB}/markdown_it/rules_inline/escape.py
119112
${PYSITELIB}/markdown_it/rules_inline/escape.pyc
113+
${PYSITELIB}/markdown_it/rules_inline/fragments_join.py
114+
${PYSITELIB}/markdown_it/rules_inline/fragments_join.pyc
120115
${PYSITELIB}/markdown_it/rules_inline/html_inline.py
121116
${PYSITELIB}/markdown_it/rules_inline/html_inline.pyc
122117
${PYSITELIB}/markdown_it/rules_inline/image.py
123118
${PYSITELIB}/markdown_it/rules_inline/image.pyc
124119
${PYSITELIB}/markdown_it/rules_inline/link.py
125120
${PYSITELIB}/markdown_it/rules_inline/link.pyc
121+
${PYSITELIB}/markdown_it/rules_inline/linkify.py
122+
${PYSITELIB}/markdown_it/rules_inline/linkify.pyc
126123
${PYSITELIB}/markdown_it/rules_inline/newline.py
127124
${PYSITELIB}/markdown_it/rules_inline/newline.pyc
128125
${PYSITELIB}/markdown_it/rules_inline/state_inline.py
@@ -131,11 +128,18 @@ ${PYSITELIB}/markdown_it/rules_inline/strikethrough.py
131128
${PYSITELIB}/markdown_it/rules_inline/strikethrough.pyc
132129
${PYSITELIB}/markdown_it/rules_inline/text.py
133130
${PYSITELIB}/markdown_it/rules_inline/text.pyc
134-
${PYSITELIB}/markdown_it/rules_inline/text_collapse.py
135-
${PYSITELIB}/markdown_it/rules_inline/text_collapse.pyc
136131
${PYSITELIB}/markdown_it/token.py
137132
${PYSITELIB}/markdown_it/token.pyc
138133
${PYSITELIB}/markdown_it/tree.py
139134
${PYSITELIB}/markdown_it/tree.pyc
140135
${PYSITELIB}/markdown_it/utils.py
141136
${PYSITELIB}/markdown_it/utils.pyc
137+
${PYSITELIB}/${WHEEL_INFODIR}/INSTALLER
138+
${PYSITELIB}/${WHEEL_INFODIR}/LICENSE
139+
${PYSITELIB}/${WHEEL_INFODIR}/LICENSE.markdown-it
140+
${PYSITELIB}/${WHEEL_INFODIR}/METADATA
141+
${PYSITELIB}/${WHEEL_INFODIR}/RECORD
142+
${PYSITELIB}/${WHEEL_INFODIR}/REQUESTED
143+
${PYSITELIB}/${WHEEL_INFODIR}/WHEEL
144+
${PYSITELIB}/${WHEEL_INFODIR}/direct_url.json
145+
${PYSITELIB}/${WHEEL_INFODIR}/entry_points.txt

textproc/py-markdown-it-py/distinfo

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
$NetBSD: distinfo,v 1.2 2023/03/05 07:27:37 adam Exp $
1+
$NetBSD: distinfo,v 1.3 2023/06/06 08:21:18 wiz Exp $
22

3-
BLAKE2s (markdown-it-py-2.2.0.tar.gz) = acc8bf0cd757c6027db4716829bb250f594d43c2fdc61ba7885621f666397536
4-
SHA512 (markdown-it-py-2.2.0.tar.gz) = 3b9b8d91dd21cdc750025588fe489ad82b1f9003fdb50b179c4657f2c1fdc3a69c32d7532896fc2303a544e4576dada30ea7ec139024983aa693f93d17df3a34
5-
Size (markdown-it-py-2.2.0.tar.gz) = 67120 bytes
3+
BLAKE2s (markdown-it-py-3.0.0.tar.gz) = 6dce14563475d1c36927e0b3b9b81923a37e6b8d7c9626967d9fd858383e5488
4+
SHA512 (markdown-it-py-3.0.0.tar.gz) = a862b450ad1d530320d9ece7b2dc370152105c568e9d79df622aaba84b986a3e24326f6cbca313d66edf9a61823d91076b815f81b978fae663d6d7cc239a5ac1
5+
Size (markdown-it-py-3.0.0.tar.gz) = 74596 bytes

0 commit comments

Comments
 (0)