Add tables to Markdown.
| 226 | |
| 227 | |
| 228 | class TableExtension(Extension): |
| 229 | """ Add tables to Markdown. """ |
| 230 | |
| 231 | def __init__(self, **kwargs): |
| 232 | self.config = { |
| 233 | 'use_align_attribute': [False, 'True to use align attribute instead of style.'], |
| 234 | } |
| 235 | """ Default configuration options. """ |
| 236 | |
| 237 | super().__init__(**kwargs) |
| 238 | |
| 239 | def extendMarkdown(self, md): |
| 240 | """ Register the processor. |
| 241 | |
| 242 | | Class Instance | Registry | Name | Priority | |
| 243 | | ------------------------------------------------------------- | ---------------------------------------------------------------- | ------ | :------: | |
| 244 | | [`TableProcessor`][markdown.extensions.tables.TableProcessor] | [`blockprocessors`][markdown.blockprocessors.build_block_parser] | `table` | `75` | |
| 245 | |
| 246 | """ |
| 247 | # flake8: noqa: E501 242-244 |
| 248 | if '|' not in md.ESCAPED_CHARS: |
| 249 | md.ESCAPED_CHARS.append('|') |
| 250 | processor = TableProcessor(md.parser, self.getConfigs()) |
| 251 | md.parser.blockprocessors.register(processor, 'table', 75) |
| 252 | |
| 253 | |
| 254 | def makeExtension(**kwargs): # pragma: no cover |
no outgoing calls