From c1e5f4528381c26eac599e455cfbe9b02582cb29 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Fri, 2 Jun 2023 20:57:02 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=80=BC=EF=B8=8F=20Remove=20(p)=20=3D>=20?= =?UTF-8?q?=C2=A7=20replacement=20in=20typographer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `(p)` is no longer replaced with § by typographer (conflicts with ℗) Implements upstream: https://github.com/markdown-it/markdown-it/commit/f52351499be1e6c838110c31e07154cce1d91d47 --- markdown_it/rules_core/replacements.py | 9 ++++----- tests/test_port/fixtures/typographer.md | 9 --------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/markdown_it/rules_core/replacements.py b/markdown_it/rules_core/replacements.py index 0b6e86af..14912e17 100644 --- a/markdown_it/rules_core/replacements.py +++ b/markdown_it/rules_core/replacements.py @@ -3,7 +3,6 @@ * ``(c)``, ``(C)`` → © * ``(tm)``, ``(TM)`` → ™ * ``(r)``, ``(R)`` → ® -* ``(p)``, ``(P)`` → § * ``+-`` → ± * ``...`` → … * ``?....`` → ?.. @@ -26,15 +25,15 @@ # TODO: # - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ -# - miltiplication 2 x 4 -> 2 × 4 +# - multiplication 2 x 4 -> 2 × 4 RARE_RE = re.compile(r"\+-|\.\.|\?\?\?\?|!!!!|,,|--") # Workaround for phantomjs - need regex without /g flag, # or root check will fail every second time -# SCOPED_ABBR_TEST_RE = r"\((c|tm|r|p)\)" +# SCOPED_ABBR_TEST_RE = r"\((c|tm|r)\)" -SCOPED_ABBR_RE = re.compile(r"\((c|tm|r|p)\)", flags=re.IGNORECASE) +SCOPED_ABBR_RE = re.compile(r"\((c|tm|r)\)", flags=re.IGNORECASE) PLUS_MINUS_RE = re.compile(r"\+-") @@ -53,7 +52,7 @@ EN_DASH_INDENT_RE = re.compile(r"(^|[^-\s])--(?=[^-\s]|$)", flags=re.MULTILINE) -SCOPED_ABBR = {"c": "©", "r": "®", "p": "§", "tm": "™"} +SCOPED_ABBR = {"c": "©", "r": "®", "tm": "™"} def replaceFn(match: re.Match[str]) -> str: diff --git a/tests/test_port/fixtures/typographer.md b/tests/test_port/fixtures/typographer.md index d72a7c2f..23825e5d 100644 --- a/tests/test_port/fixtures/typographer.md +++ b/tests/test_port/fixtures/typographer.md @@ -41,15 +41,6 @@ trademark

™ ™

. - -paragraph -. -(p) (P) -. -

§ §

-. - - plus-minus . +-5 From 1149689be17acb16d918ecd63cb56fc3386f0189 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Fri, 2 Jun 2023 21:00:50 +0200 Subject: [PATCH 2/2] Update port.yaml --- markdown_it/port.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/markdown_it/port.yaml b/markdown_it/port.yaml index a553fe1a..3e289e9e 100644 --- a/markdown_it/port.yaml +++ b/markdown_it/port.yaml @@ -1,7 +1,7 @@ - package: markdown-it/markdown-it - version: 12.3.2 - commit: d72c68b520cedacae7878caa92bf7fe32e3e0e6f - date: Jan 8, 2022 + version: 13.0.1 + commit: e843acc9edad115cbf8cf85e676443f01658be08 + date: May 3, 2022 notes: - Rename variables that use python built-in names, e.g. - `max` -> `maximum`