‹›
markdown.serializers
¶
Python-Markdown provides two serializers which render ElementTree.Element
objects to a string of HTML. Both functions wrap the same underlying code with only a few minor
differences as outlined below:
- Empty (self-closing) tags are rendered as
<tag>for HTML and as<tag />for XHTML. - Boolean attributes are rendered as
attrnamefor HTML and asattrname="attrname"for XHTML.
Functions:
-
to_html_string–Serialize element and its children to a string of HTML5.
-
to_xhtml_string–Serialize element and its children to a string of XHTML.

