html_to_markdown#

scikitplot._externals._sphinx_ext._sphinx_ai_assistant.html_to_markdown(html_content, strip_tags=None)[source]#

Convert an HTML string to Markdown using the Sphinx-tuned converter.

Parameters:
html_contentstr

Raw HTML string to convert.

strip_tagslist of str or None, optional

HTML tag names whose elements (including all their content) are removed before conversion. Defaults to ["script", "style"] when None.

Returns:
str

Markdown representation of the HTML content.

Raises:
ImportError

If markdownify is not installed.

Parameters:
  • html_content (str)

  • strip_tags (List[str] | None)

Return type:

str

See also

_build_converter_class

Factory for the converter class.

Notes

bs4 is imported lazily inside this function. If it is not available the stripping step is skipped silently; markdownify’s own strip= option still removes the listed tags from the output.

The converter itself is cached between calls (module-level singleton).

Examples

>>> html_to_markdown("<h1>Hello</h1><p>World</p>")
'# Hello\n\nWorld\n\n'