MCPcopy
hub / github.com/Python-Markdown/markdown / store

Method store

markdown/util.py:229–245  ·  view source on GitHub ↗

Saves an HTML segment for later reinsertion. Returns a placeholder string that needs to be inserted into the document. Keyword arguments: html: An html segment. Returns: A placeholder string.

(self, html: str | etree.Element)

Source from the content-addressed store, hash-verified

227 self.tag_data: list[TagData] = [] # list of dictionaries in the order tags appear
228
229 def store(self, html: str | etree.Element) -> str:
230 """
231 Saves an HTML segment for later reinsertion. Returns a
232 placeholder string that needs to be inserted into the
233 document.
234
235 Keyword arguments:
236 html: An html segment.
237
238 Returns:
239 A placeholder string.
240
241 """
242 self.rawHtmlBlocks.append(html)
243 placeholder = self.get_placeholder(self.html_counter)
244 self.html_counter += 1
245 return placeholder
246
247 def reset(self) -> None:
248 """ Clear the stash. """

Callers 13

closeMethod · 0.80
handle_endtagMethod · 0.80
handle_empty_tagMethod · 0.80
handleMatchMethod · 0.80
runMethod · 0.80
runMethod · 0.80
handle_starttagMethod · 0.80
handle_endtagMethod · 0.80
handle_empty_tagMethod · 0.80
handleMatchMethod · 0.80
setUpMethod · 0.80
testStoreMoreMethod · 0.80

Calls 1

get_placeholderMethod · 0.95

Tested by 3

setUpMethod · 0.64
testStoreMoreMethod · 0.64