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

Function render_inner_html

markdown/extensions/toc.py:160–170  ·  view source on GitHub ↗

Fully render inner html of an `etree` element as a string.

(el: etree.Element, md: Markdown)

Source from the content-addressed store, hash-verified

158
159
160def render_inner_html(el: etree.Element, md: Markdown) -> str:
161 """ Fully render inner html of an `etree` element as a string. """
162 # The `UnescapeTreeprocessor` runs after `toc` extension so run here.
163 text = unescape(md.serializer(el))
164
165 # strip parent tag
166 start = text.index('>') + 1
167 end = text.rindex('<')
168 text = text[start:end].strip()
169
170 return run_postprocessors(text, md)
171
172
173def remove_fnrefs(root: etree.Element) -> etree.Element:

Callers 1

runMethod · 0.85

Calls 2

unescapeFunction · 0.85
run_postprocessorsFunction · 0.85

Tested by

no test coverage detected