utkarshkukreti / markup.rs

A blazing fast, type-safe template engine for Rust.
Apache License 2.0
350 stars 14 forks source link

Option to make the HTML output also be parseable as well-formed schemaless XML #34

Open gsnoff opened 10 months ago

gsnoff commented 10 months ago

Some applications can make use of existing XML parsers for automated data manipulation (e.g. with XPath/XQuery/XSLT, but not necessarily), and since HTML parsing rules derive from SGML, it might be useful to generate output that passes both as valid HTML5 and as well-formed XML.

For example, the following self-closing element:

<input checked>

upon enabling such an option would become like:

<input checked="checked" />

(Note the space in front of the trailing slash, which is required here by SGML-derived HTML parsing rules.)