Html
NAME¶
html - HTML Entities encoding
DESCRIPTION¶
Encodes each character with its html escaped entity, based on the WHATWG HTML Living Standard. The full list of named character is available at https://html.spec.whatwg.org/multipage/named-characters.html
This encoder uses Python's html.entities module for the named characters, and encodes the others with their decimal or hexadecimal representation.
OPTIONS¶
--include¶
Characters that should be encoded (can contain 'all', 'utf8' or 'ascii')
--exclude¶
Characters that should not be encoded
--regex¶
Regex override for characters that should be encoded
--lowercase¶
Use lowercase hex digits
--hex¶
Use hexadecimal instead of decimal
EXAMPLES¶
| Sample | Encoded |
|---|---|
hello world |
hello world |
<p>hello</p> |
&#lt;p&#gt;hello&#lt;/p&#gt; |
<a href="/hello">hello</a> |
&#lt;a href=&#quot;/hello&#quot;&#gt;hello&#lt;/a&#gt; |
café |
caf&#eacute; |