MCPcopy
hub / github.com/npmx-dev/npmx.dev / decodeHtmlEntities

Function decodeHtmlEntities

shared/utils/html.ts:11–13  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

9}
10
11export function decodeHtmlEntities(text: string): string {
12 return text.replace(/&(?:amp|lt|gt|quot|apos|nbsp|#39);/g, match => htmlEntities[match] || match)
13}
14
15/**
16 * Strip all HTML tags from a string, looping until stable to prevent

Callers 6

html.spec.tsFile · 0.90
stripAndEscapeHtmlFunction · 0.90
getHeadingPlainTextFunction · 0.90
renderReadmeHtmlFunction · 0.90
processLinkFunction · 0.90
slugifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected