Documentation
¶
Overview ¶
Package entity resolves HTML character references: the named references of the WHATWG HTML standard (section 13.5, embedded from entities.txt) and the numeric ones with the standard's replacement rules.
Index ¶
Constants ¶
const MaxName = 31
MaxName is the length of the longest name, without "&" and ";".
Variables ¶
This section is empty.
Functions ¶
func Lookup ¶
Lookup returns what the reference "&name" stands for, name including its ";" if it has one.
func Named ¶
Named finds the longest named character reference at the start of s, which follows an "&". It returns what the reference stands for, the bytes of s it takes (its ";" included when it has one), and whether that final ";" was there.
func Numeric ¶
Numeric returns the character a numeric character reference to code point v stands for, following the standard's "numeric character reference end state": zero, a surrogate or a value beyond U+10FFFF is U+FFFD, and a C1 control is the windows-1252 character of its byte. Other noncharacters and controls are returned as they are.
Types ¶
This section is empty.