MCPcopy Index your code
hub / github.com/python/cpython / html2text

Function html2text

Lib/test/test_pydoc/test_pydoc.py:367–376  ·  view source on GitHub ↗

A quick and dirty implementation of html2text. Tailored for pydoc tests only.

(html)

Source from the content-addressed store, hash-verified

365
366
367def html2text(html):
368 """A quick and dirty implementation of html2text.
369
370 Tailored for pydoc tests only.
371 """
372 html = html.replace("<dd>", "\n")
373 html = html.replace("<hr>", "-"*70)
374 html = re.sub("<.*?>", "", html)
375 html = pydoc.replace(html, "&nbsp;", " ", "&gt;", ">", "&lt;", "<")
376 return html
377
378
379class PydocBaseTest(unittest.TestCase):

Callers 4

test_html_docMethod · 0.85
test_method_aliasesMethod · 0.85

Calls 2

replaceMethod · 0.45
subMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…