‹› markdown.extensions.fenced_code

This extension adds Fenced Code Blocks to Python-Markdown.

See the documentation for details.

‹› markdown.extensions.fenced_code.FencedCodeExtension(**kwargs)

Bases: Extension

‹› markdown.extensions.fenced_code.FencedCodeExtension.config instance-attribute

Default configuration options.

Defined Value:

self.config = {
    'lang_prefix': ['language-', 'Prefix prepended to the language. Default: "language-"']
}

‹› markdown.extensions.fenced_code.FencedCodeExtension.extendMarkdown(md)

Add FencedBlockPreprocessor to the Markdown instance.

‹› markdown.extensions.fenced_code.FencedBlockPreprocessor(md: Markdown, config: dict[str, Any])

Bases: Preprocessor

Find and extract fenced code blocks.

‹› markdown.extensions.fenced_code.FencedBlockPreprocessor.run(lines: list[str]) -> list[str]

Match and store Fenced Code Blocks in the HtmlStash.

‹› markdown.extensions.fenced_code.FencedBlockPreprocessor.handle_attrs(attrs: Iterable[tuple[str, str]]) -> tuple[str, list[str], dict[str, Any]]

Return tuple: (id, [list, of, classes], {configs})