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.

alias of MutableMapping[str, Any]

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(*args, **kwargs)[source]#

Bases: dict

Options for parsing.

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.

typographer: bool#

Enable smartquotes and replacements.

xhtmlOut: bool#

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

class markdown_it.utils.PresetType(*args, **kwargs)[source]#

Bases: dict

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]#