Skip to content

Commit

Permalink
👌 Add "store_labels" to OptionsType
Browse files Browse the repository at this point in the history
  • Loading branch information
hukkin committed Nov 14, 2024
1 parent c10312e commit b9cb808
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions markdown_it/presets/commonmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def make() -> PresetType:
# function (/*str, lang, attrs*/) { return ''; }
#
"highlight": None,
# Python implementation specific:
# Store link label in link/image token's metadata (under Token.meta['label']).
"store_labels": False,
},
"components": {
"core": {"rules": ["normalize", "block", "inline", "text_join"]},
Expand Down
3 changes: 3 additions & 0 deletions markdown_it/presets/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def make() -> PresetType:
# function (/*str, lang, attrs*/) { return ''; }
#
"highlight": None,
# Python implementation specific:
# Store link label in link/image token's metadata (under Token.meta['label']).
"store_labels": False,
},
"components": {"core": {}, "block": {}, "inline": {}},
}
3 changes: 3 additions & 0 deletions markdown_it/presets/zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def make() -> PresetType:
# If result starts with <pre... internal wrapper is skipped.
# function (/*str, lang, attrs*/) { return ''; }
"highlight": None,
# Python implementation specific:
# Store link label in link/image token's metadata (under Token.meta['label']).
"store_labels": False,
},
"components": {
"core": {"rules": ["normalize", "block", "inline", "text_join"]},
Expand Down
2 changes: 2 additions & 0 deletions markdown_it/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class OptionsType(TypedDict):
"""CSS language prefix for fenced blocks."""
highlight: Callable[[str, str, str], str] | None
"""Highlighter function: (content, lang, attrs) -> str."""
store_labels: bool
"""Store link label in link/image token's metadata (under Token.meta['label'])."""


class PresetType(TypedDict):
Expand Down

0 comments on commit b9cb808

Please sign in to comment.