Module encoding/html

encoding/html

HTML entity decoding — named, decimal, and hexadecimal character references.

Decodes named (&), decimal (&), and hex (&) HTML character references. Uses Legacy mode — entities without trailing semicolon are also decoded.

Example

{ decode_html } :: import "std/encoding/html";

result := decode_html(`& < & &`);
assert((result == `& < & &`), "decoded entities");

Functions

decode_html function
fn(input : String) -> String

Decode HTML entities in a string.

Supports named (&amp;), decimal (&#38;), and hexadecimal (&#x26;) character references. Legacy mode — entities without trailing semicolons are also decoded.

Parameters

NameTypeNotes
inputString

Returns: String

fn(c : i32) -> bool

Parameters

NameTypeNotes
ci32

Returns: bool

from_code_point function
fn(c : i32) -> String

Parameters

NameTypeNotes
ci32

Returns: String