Skip to content

Commit 9a06bfc

Browse files
authored
🐛 FIX: Porting regressions (#141)
Fix a few mistaken regressions from #140
1 parent 29a8d5e commit 9a06bfc

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

markdown_it/renderer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ def fence(self, tokens: Sequence[Token], idx: int, options, env) -> str:
222222
langAttrs = ""
223223

224224
if info:
225-
langName = info.split()[0]
226225
arr = info.split(maxsplit=1)
227226
langName = arr[0]
228227
if len(arr) == 2:

markdown_it/rules_inline/autolink.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Process autolinks '<protocol:...>'
22
import re
33
from .state_inline import StateInline
4-
from ..common.normalize_url import normalizeLinkText, normalizeLink, validateLink
54

65
EMAIL_RE = re.compile(
76
r"^([a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$" # noqa: E501
@@ -34,8 +33,8 @@ def autolink(state: StateInline, silent: bool) -> bool:
3433
url = state.src[start + 1 : pos]
3534

3635
if AUTOLINK_RE.search(url) is not None:
37-
fullUrl = normalizeLink(url)
38-
if not validateLink(fullUrl):
36+
fullUrl = state.md.normalizeLink(url)
37+
if not state.md.validateLink(fullUrl):
3938
return False
4039

4140
if not silent:
@@ -45,7 +44,7 @@ def autolink(state: StateInline, silent: bool) -> bool:
4544
token.info = "auto"
4645

4746
token = state.push("text", "", 0)
48-
token.content = normalizeLinkText(url)
47+
token.content = state.md.normalizeLinkText(url)
4948

5049
token = state.push("link_close", "a", -1)
5150
token.markup = "autolink"
@@ -55,8 +54,8 @@ def autolink(state: StateInline, silent: bool) -> bool:
5554
return True
5655

5756
if EMAIL_RE.search(url) is not None:
58-
fullUrl = normalizeLink("mailto:" + url)
59-
if not validateLink(fullUrl):
57+
fullUrl = state.md.normalizeLink("mailto:" + url)
58+
if not state.md.validateLink(fullUrl):
6059
return False
6160

6261
if not silent:
@@ -66,7 +65,7 @@ def autolink(state: StateInline, silent: bool) -> bool:
6665
token.info = "auto"
6766

6867
token = state.push("text", "", 0)
69-
token.content = normalizeLinkText(url)
68+
token.content = state.md.normalizeLinkText(url)
7069

7170
token = state.push("link_close", "a", -1)
7271
token.markup = "autolink"

markdown_it/rules_inline/strikethrough.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def tokenize(state: StateInline, silent: bool):
3535
**{
3636
"marker": marker,
3737
"length": 0, # disable "rule of 3" length checks meant for emphasis
38-
"jump": i // 2, # for `~~` 1 marker = 2 characters,
38+
"jump": i // 2, # for `~~` 1 marker = 2 characters
3939
"token": len(state.tokens) - 1,
4040
"end": -1,
4141
"open": scanned.can_open,

tests/test_port/fixtures/tables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ GFM 4.10 Tables (extension), Example 203
839839
| --- |
840840
| bar |</p>
841841
.
842+
842843
GFM 4.10 Tables (extension), Example 204
843844
.
844845
| abc | def |

0 commit comments

Comments
 (0)