Skip to content
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

👌 Add "store_labels" to OptionsType #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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
Loading