Skip to content

Commit

Permalink
‼️ Remove (p) => § replacement in typographer (#281)
Browse files Browse the repository at this point in the history
`(p)` is no longer replaced with § by typographer (conflicts with ℗)

Implements upstream: markdown-it/markdown-it@f523514
  • Loading branch information
chrisjsewell committed Jun 2, 2023
1 parent d5b3874 commit dd51f62
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
6 changes: 3 additions & 3 deletions 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`
Expand Down
9 changes: 4 additions & 5 deletions markdown_it/rules_core/replacements.py
Expand Up @@ -3,7 +3,6 @@
* ``(c)``, ``(C)`` → ©
* ``(tm)``, ``(TM)`` → ™
* ``(r)``, ``(R)`` → ®
* ``(p)``, ``(P)`` → §
* ``+-`` → ±
* ``...`` → …
* ``?....`` → ?..
Expand All @@ -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"\+-")

Expand All @@ -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:
Expand Down
9 changes: 0 additions & 9 deletions tests/test_port/fixtures/typographer.md
Expand Up @@ -41,15 +41,6 @@ trademark
<p>™ ™</p>
.


paragraph
.
(p) (P)
.
<p>§ §</p>
.


plus-minus
.
+-5
Expand Down

0 comments on commit dd51f62

Please sign in to comment.