markdown_it.utils module#

markdown_it.utils.EnvType#

Type for the environment sandbox used in parsing and rendering, which stores mutable variables for use by plugins and rules.

class markdown_it.utils.OptionsDict(options: OptionsType)[source]#

Bases: MutableMapping

A dictionary, with attribute access to core markdownit configuration options.

property breaks: bool#

Convert newlines in paragraphs into <br>.

property highlight: Callable[[str, str, str], str] | None#

Highlighter function: (content, langName, langAttrs) -> escaped HTML.

property html: bool#

Enable HTML tags in source.

property langPrefix: str#

CSS language prefix for fenced blocks.

property linkify: bool#

Enable autoconversion of URL-like texts to links.

property maxNesting: int#

Internal protection, recursion limit.

property quotes: str#

Quote characters.

property typographer: bool#

Enable smartquotes and replacements.

property xhtmlOut: bool#

Use ‘/’ to close single tags (<br />).

class markdown_it.utils.OptionsType[source]#

Bases: TypedDict

Options for parsing.

alerts: NotRequired[bool]#

Enable GitHub-style alert detection in blockquotes.

breaks: bool#

Convert newlines in paragraphs into <br>.

highlight: Callable[[str, str, str], str] | None#

Highlighter function: (content, lang, attrs) -> str.

html: bool#

Enable HTML tags in source.

langPrefix: str#

CSS language prefix for fenced blocks.

linkify: bool#

Enable autoconversion of URL-like texts to links.

maxNesting: int#

Internal protection, recursion limit.

quotes: str#

Quote characters.

store_labels: NotRequired[bool]#

Store link label in link/image token’s metadata (under Token.meta[‘label’]).

This is a Python only option, and is intended for the use of round-trip parsing.

strikethrough_single_tilde: NotRequired[bool]#

Allow single tilde ~text~ for strikethrough in addition to double.

tasklists: NotRequired[bool]#

Enable GFM task list checkbox detection in list items.

tasklists_editable: NotRequired[bool]#

When True, rendered task list checkboxes are interactive (no disabled attribute).

typographer: bool#

Enable smartquotes and replacements.

xhtmlOut: bool#

Use ‘/’ to close single tags (<br />).

class markdown_it.utils.PresetType[source]#

Bases: TypedDict

Preset configuration for markdown-it.

components: MutableMapping[str, MutableMapping[str, list[str]]]#

Components for parsing and rendering.

options: OptionsType#

Options for parsing.

markdown_it.utils.read_fixture_file(path: str | Path) list[list[Any]][source]#