‹› markdown.extensions.attr_list

Adds attribute list syntax. Inspired by Maruku’s feature of the same name.

See the documentation for details.

‹› markdown.extensions.attr_list.get_attrs(str: str) -> list[tuple[str, str]]

Parse attribute list and return a list of attribute tuples.

‹› markdown.extensions.attr_list.AttrListTreeprocessor(md: Markdown | None = None)

Bases: Treeprocessor

‹› markdown.extensions.attr_list.AttrListTreeprocessor.assign_attrs(elem: Element, attrs: str) -> None

Assign attrs to element.

‹› markdown.extensions.attr_list.AttrListTreeprocessor.sanitize_name(name: str) -> str

Sanitize name as ‘an XML Name, minus the “:”’. See https://www.w3.org/TR/REC-xml-names/#NT-NCName

‹› markdown.extensions.attr_list.AttrListExtension(**kwargs)

Bases: Extension

Attribute List extension for Python-Markdown