MCPcopy Index your code
hub / github.com/Python-Markdown/markdown / close

Method close

markdown/htmlparser.py:153–166  ·  view source on GitHub ↗

Handle any buffered data.

(self)

Source from the content-addressed store, hash-verified

151 super().reset()
152
153 def close(self):
154 """Handle any buffered data."""
155 super().close()
156 if len(self.rawdata):
157 # Temp fix for https://bugs.python.org/issue41989
158 # TODO: remove this when the bug is fixed in all supported Python versions.
159 if self.convert_charrefs and not self.cdata_elem: # pragma: no cover
160 self.handle_data(htmlparser.unescape(self.rawdata))
161 else:
162 self.handle_data(self.rawdata)
163 # Handle any unclosed tags.
164 if len(self._cache):
165 self.cleandoc.append(self.md.htmlStash.store(''.join(self._cache)))
166 self._cache = []
167
168 @property
169 def line_offset(self) -> int:

Callers 2

runMethod · 0.95
convertFileMethod · 0.45

Calls 3

handle_dataMethod · 0.95
storeMethod · 0.80
unescapeMethod · 0.45

Tested by

no test coverage detected