HTML conversion
Requires the html feature (enabled by default).
Converting an HTML fragment
Gukhanmun parses the input as an HTML fragment (not a full document), converts hanja in text nodes and attributes, and serialises the result while preserving all tags and attributes exactly.
Elements that are always preserved
These elements are never modified:
<code>,<kbd>,<pre>,<samp><script>,<style>,<textarea>- Elements with
translate="no" <ruby>annotation content (<rt>,<rp>)
Custom preservation rules
Use builder.html_preserve_when to register a predicate that receives the
tag name and attributes of each element and returns true to skip conversion:
Multiple calls to html_preserve_when add additional predicates; any
predicate returning true causes the element (and its descendants) to be
preserved.