Parse a chunk of Markdown text and attach to given `etree` node. While the `text` argument is generally assumed to contain multiple blocks which will be split on blank lines, it could contain only one block. Generally, this method would be called by extensions when
(self, parent: etree.Element, text: str)
| 118 | return etree.ElementTree(self.root) |
| 119 | |
| 120 | def parseChunk(self, parent: etree.Element, text: str) -> None: |
| 121 | """ Parse a chunk of Markdown text and attach to given `etree` node. |
| 122 | |
| 123 | While the `text` argument is generally assumed to contain multiple |
| 124 | blocks which will be split on blank lines, it could contain only one |
| 125 | block. Generally, this method would be called by extensions when |
| 126 | block parsing is required. |
| 127 | |
| 128 | The `parent` `etree` Element passed in is altered in place. |
| 129 | Nothing is returned. |
| 130 | |
| 131 | Arguments: |
| 132 | parent: The parent element. |
| 133 | text: The text to parse. |
| 134 | |
| 135 | """ |
| 136 | self.parseBlocks(parent, text.split('\n\n')) |
| 137 | |
| 138 | def parseBlocks(self, parent: etree.Element, blocks: list[str]) -> None: |
| 139 | """ Process blocks of Markdown text and attach to given `etree` node. |