Skip to content
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
1 change: 0 additions & 1 deletion markdown_it/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def fence(self, tokens: Sequence[Token], idx: int, options, env) -> str:
langAttrs = ""

if info:
langName = info.split()[0]
arr = info.split(maxsplit=1)
langName = arr[0]
if len(arr) == 2:
Expand Down
13 changes: 6 additions & 7 deletions markdown_it/rules_inline/autolink.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Process autolinks '<protocol:...>'
import re
from .state_inline import StateInline
from ..common.normalize_url import normalizeLinkText, normalizeLink, validateLink

EMAIL_RE = re.compile(
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
Expand Down Expand Up @@ -34,8 +33,8 @@ def autolink(state: StateInline, silent: bool) -> bool:
url = state.src[start + 1 : pos]

if AUTOLINK_RE.search(url) is not None:
fullUrl = normalizeLink(url)
if not validateLink(fullUrl):
fullUrl = state.md.normalizeLink(url)
if not state.md.validateLink(fullUrl):
return False

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

token = state.push("text", "", 0)
token.content = normalizeLinkText(url)
token.content = state.md.normalizeLinkText(url)

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

if EMAIL_RE.search(url) is not None:
fullUrl = normalizeLink("mailto:" + url)
if not validateLink(fullUrl):
fullUrl = state.md.normalizeLink("mailto:" + url)
if not state.md.validateLink(fullUrl):
return False

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

token = state.push("text", "", 0)
token.content = normalizeLinkText(url)
token.content = state.md.normalizeLinkText(url)

token = state.push("link_close", "a", -1)
token.markup = "autolink"
Expand Down
2 changes: 1 addition & 1 deletion markdown_it/rules_inline/strikethrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def tokenize(state: StateInline, silent: bool):
**{
"marker": marker,
"length": 0, # disable "rule of 3" length checks meant for emphasis
"jump": i // 2, # for `~~` 1 marker = 2 characters,
"jump": i // 2, # for `~~` 1 marker = 2 characters
"token": len(state.tokens) - 1,
"end": -1,
"open": scanned.can_open,
Expand Down
1 change: 1 addition & 0 deletions tests/test_port/fixtures/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ GFM 4.10 Tables (extension), Example 203
| --- |
| bar |</p>
.

GFM 4.10 Tables (extension), Example 204
.
| abc | def |
Expand Down