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

Method unescape

markdown/inlinepatterns.py:264–280  ·  view source on GitHub ↗

Return unescaped text given text with an inline placeholder.

(self, text: str)

Source from the content-addressed store, hash-verified

262 return self.__class__.__name__
263
264 def unescape(self, text: str) -> str:
265 """ Return unescaped text given text with an inline placeholder. """
266 try:
267 stash = self.md.treeprocessors['inline'].stashed_nodes
268 except KeyError: # pragma: no cover
269 return text
270
271 def get_stash(m):
272 id = m.group(1)
273 if id in stash:
274 value = stash.get(id)
275 if isinstance(value, str):
276 return value
277 else:
278 # An `etree` Element - return text content only
279 return ''.join(value.itertext())
280 return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text)
281
282
283class InlineProcessor(Pattern):

Callers 9

closeMethod · 0.45
parse_starttagMethod · 0.45
getLinkMethod · 0.45
handleMatchMethod · 0.45
makeTagMethod · 0.45
handleMatchMethod · 0.45
handleMatchMethod · 0.45
get_nameFunction · 0.45
runMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected