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

Method store

markdown/util.py:226–242  ·  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

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

Callers 14

py_renderFunction · 0.80
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

Calls 1

get_placeholderMethod · 0.95

Tested by 3

setUpMethod · 0.64
testStoreMoreMethod · 0.64