parse.ts#
3 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference#
fndecodeHtmlEntities(value: string): stringExpand the character references that show up in <meta> content. Metadata is mar…
Expand the character references that show up in <meta> content.
Metadata is markup, so an og:title of Tips & Tricks reaches us as Tips & Tricks. Rendering that verbatim puts the raw entity on the card, and it is the renderer's job — not the author's — to escape the text again.
Signature
export function decodeHtmlEntities(value: string): stringParameters
-
valuestring
Returns
string
fnfaviconUrl(html: string, pageUrl: string): string | undefinedThe site's own icon, never a third-party favicon lookup service. Routing every…
The site's own icon, never a third-party favicon lookup service.
Routing every card through an external service would tell that service which outbound links each documentation page carries, for every reader, and would make cards depend on a host the build never chose.
Signature
function faviconUrl(html: string, pageUrl: string): string | undefinedParameters
-
htmlstring -
pageUrlstring
Returns
string | undefined
fnresolveMetaUrl(value: string, pageUrl: string): string | undefinedResolve a URL taken from page metadata against the page it came from. Open Grap…
Resolve a URL taken from page metadata against the page it came from.
Open Graph lets a site write og:image as an absolute URL, a protocol-relative one, or a path relative to the document. Only the first form is usable as-is: the other two have to be resolved against the source page, not against whatever docs page ends up embedding the card.
Signature
export function resolveMetaUrl(value: string, pageUrl: string): string | undefinedParameters
-
valuestring -
pageUrlstring
Returns
string | undefined