Skip to content

⬆️ Update: Sync with markdown-it v12.1.0 and CommonMark v0.30 #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions markdown_it/port.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- package: markdown-it/markdown-it
version: 12.0.6
commit: df4607f1d4d4be7fdc32e71c04109aea8cc373fa
date: Apr 16, 2021
version: 12.1.0
commit: 13cdeb95abccc78a5ce17acf9f6e8cf5b9ce713b
date: Jul 1, 2021
notes:
- Rename variables that use python built-in names, e.g.
- `max` -> `maximum`
Expand Down
4 changes: 2 additions & 2 deletions markdown_it/rules_block/html_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# last argument defines whether it can terminate a paragraph or not
HTML_SEQUENCES: List[Tuple[Pattern, Pattern, bool]] = [
(
re.compile(r"^<(script|pre|style)(?=(\s|>|$))", re.IGNORECASE),
re.compile(r"<\/(script|pre|style)>", re.IGNORECASE),
re.compile(r"^<(script|pre|style|textarea)(?=(\s|>|$))", re.IGNORECASE),
re.compile(r"<\/(script|pre|style|textarea)>", re.IGNORECASE),
True,
),
(re.compile(r"^<!--"), re.compile(r"-->"), True),
Expand Down
14 changes: 10 additions & 4 deletions markdown_it/rules_inline/balance_pairs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@ def processDelimiters(state: StateInline, delimiters, *args):
continue

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

minOpenerIdx = openersBottom[closer.marker][closer.length % 3]
minOpenerIdx = openersBottom[closer.marker][
(3 if closer.open else 0) + (closer.length % 3)
]

openerIdx = closerIdx - closer.jump - 1

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

closerIdx += 1

Expand Down
Loading