diff --git a/markdown_it/renderer.py b/markdown_it/renderer.py index 2dd25ecc..4452c34e 100644 --- a/markdown_it/renderer.py +++ b/markdown_it/renderer.py @@ -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: diff --git a/markdown_it/rules_inline/autolink.py b/markdown_it/rules_inline/autolink.py index f810629f..8ad2b304 100644 --- a/markdown_it/rules_inline/autolink.py +++ b/markdown_it/rules_inline/autolink.py @@ -1,7 +1,6 @@ # Process autolinks '' 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 @@ -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: @@ -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" @@ -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: @@ -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" diff --git a/markdown_it/rules_inline/strikethrough.py b/markdown_it/rules_inline/strikethrough.py index d54ab133..87af4b46 100644 --- a/markdown_it/rules_inline/strikethrough.py +++ b/markdown_it/rules_inline/strikethrough.py @@ -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, diff --git a/tests/test_port/fixtures/tables.md b/tests/test_port/fixtures/tables.md index cf7a9ec9..7539ffb5 100644 --- a/tests/test_port/fixtures/tables.md +++ b/tests/test_port/fixtures/tables.md @@ -839,6 +839,7 @@ GFM 4.10 Tables (extension), Example 203 | --- | | bar |

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