MCPcopy
hub / github.com/midudev/libros-programacion-gratis / decodeEntities

Function decodeEntities

web/scripts/import-97-things.mjs:9–16  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

7const outputPath = new URL('../src/data/programmer97Things.ts', import.meta.url);
8
9const decodeEntities = (value) =>
10 value
11 .replace(/&/g, '&')
12 .replace(/&lt;/g, '<')
13 .replace(/&gt;/g, '>')
14 .replace(/&quot;/g, '"')
15 .replace(/&#39;/g, "'")
16 .replace(/&nbsp;/g, ' ');
17
18const stripTags = (value) =>
19 decodeEntities(value.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim());

Callers 3

stripTagsFunction · 0.85
normalizeHtmlFunction · 0.85
parseAdvicePageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected