z_html_charref (zotonic_stdlib v1.29.0)

View Source

Converts HTML charrefs and entities to codepoints.

Summary

Functions

Convert a decimal charref, hex charref, or HTML entity to unicode codepoints, or return undefined on failure. The input should not include an ampersand or semicolon. charref("#38") = 38, charref("#x26") = 38, charref("amp") = 38.

Functions

charref(B)

-spec charref(binary() | string()) -> integer() | [integer()] | undefined.

Convert a decimal charref, hex charref, or HTML entity to unicode codepoints, or return undefined on failure. The input should not include an ampersand or semicolon. charref("#38") = 38, charref("#x26") = 38, charref("amp") = 38.