MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / close

Method close

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

Handle any buffered data.

(self)

Source from the content-addressed store, hash-verified

164 super().reset()
165
166 def close(self):
167 """Handle any buffered data."""
168 super().close()
169 if len(self.rawdata):
170 # Temp fix for https://bugs.python.org/issue41989
171 # TODO: remove this when the bug is fixed in all supported Python versions.
172 if self.convert_charrefs and not self.cdata_elem: # pragma: no cover
173 self.handle_data(htmlparser.unescape(self.rawdata))
174 else:
175 self.handle_data(self.rawdata)
176 # Handle any unclosed tags.
177 if len(self._cache):
178 self.cleandoc.append(self.md.htmlStash.store(''.join(self._cache)))
179 self._cache = []
180
181 @property
182 def line_offset(self) -> int:

Callers 3

runMethod · 0.95
execMethod · 0.45
convertFileMethod · 0.45

Calls 3

handle_dataMethod · 0.95
storeMethod · 0.80
unescapeMethod · 0.45

Tested by

no test coverage detected