β€Ήβ€Ί markdown.extensions.tables ΒΆ

Adds parsing of tables to Python-Markdown.

See the documentation for details.

Classes:

β€Ήβ€Ί markdown.extensions.tables.TableProcessor(parser: blockparser.BlockParser, config: dict[str, Any]) ΒΆ

Bases: BlockProcessor

Process Tables.

Methods:

  • test –

    Ensure first two rows (column header and separator row) are valid table rows.

  • run –

    Parse a table block and build table.

β€Ήβ€Ί markdown.extensions.tables.TableProcessor.test(parent: etree.Element, block: str) -> bool ΒΆ

Ensure first two rows (column header and separator row) are valid table rows.

Keep border check and separator row do avoid repeating the work.

β€Ήβ€Ί markdown.extensions.tables.TableProcessor.run(parent: etree.Element, blocks: list[str]) -> None ΒΆ

Parse a table block and build table.

β€Ήβ€Ί markdown.extensions.tables.TableExtension(**kwargs) ΒΆ

Bases: Extension

Add tables to Markdown.

Methods:

  • extendMarkdown –

    Add an instance of TableProcessor to BlockParser.

Attributes:

  • config –

    Default configuration options.

β€Ήβ€Ί markdown.extensions.tables.TableExtension.config instance-attribute ΒΆ

Default configuration options.

Defined Value:

self.config = {
    'use_align_attribute': [False, 'True to use align attribute instead of style.'],
}

β€Ήβ€Ί markdown.extensions.tables.TableExtension.extendMarkdown(md) ΒΆ

Add an instance of TableProcessor to BlockParser.