Limitations
editMarkdown writes less than HTML. The conversion keeps the structure and the text of the converted elements, and loses the rest:
- Attributes and styles. Only
hrefandtitleof links,src,altandtitleof images, thestartof ordered lists, thecheckedstate of checkboxes, the alignment and the spans of table cells, the language of code blocks and thewhite-spacedeclarations ofstyleattributes are read. Theclass,id,data-*attributes and the other styles are lost, except on the elements written as raw HTML. - Fragments. Convert takes the content of a
body. A complete page gives itsheadelements as raw HTML: see Convert a complete document. - Whitespace. The whitespace of the text is collapsed, as a browser displays it, unless a
styleattribute preserves it: see Preserved whitespace. Style sheets are not read: an element that aclassstyles withwhite-space: preis collapsed. - Code. A code block or a code span keeps the text of its content, without its elements.
- Tables. A pipe table has one header row, and one line per row. By default, a cell takes one column, the shorter rows are completed with empty cells, and the lists, code blocks and other blocks of a cell are flattened onto one line, separated by
<br>. TableSpanHandling keeps the columns of spanned cells, and ComplexTableHandling writes the other tables as raw HTML. - Forms and media.
inputelements other than checkboxes are removed.sub,sup,u,kbd,video,audioandiframeare unknown elements unless their option chooses a syntax. The other elements without a Markdown syntax are unknown elements: raw HTML, removed or unwrapped, depending onUnknownElementHandling. - Security. The converter is not a sanitizer: see Convert untrusted HTML.
The escapes are conservative: the Markdown can hold a backslash that is not needed, such as 1\.20 at the start of a table cell. It renders the same text.