MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / store

Method store

markdown/preprocessors.py:52–69  ·  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 * safe: label an html segment as safe for safemode Returns : a placeholder st

(self, html, safe=False)

Source from the content-addressed store, hash-verified

50 self.rawHtmlBlocks=[]
51
52 def store(self, html, safe=False):
53 """
54 Saves an HTML segment for later reinsertion. Returns a
55 placeholder string that needs to be inserted into the
56 document.
57
58 Keyword arguments:
59
60 * html: an html segment
61 * safe: label an html segment as safe for safemode
62
63 Returns : a placeholder string
64
65 """
66 self.rawHtmlBlocks.append((html, safe))
67 placeholder = HTML_PLACEHOLDER % self.html_counter
68 self.html_counter += 1
69 return placeholder
70
71 def reset(self):
72 self.html_counter = 0

Callers 5

runMethod · 0.80
handleMatchMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected