MCPcopy
hub / github.com/webpack/webpack / decodeHtmlEntities

Function decodeHtmlEntities

lib/html/syntax.js:3715–3725  ·  view source on GitHub ↗
(str, isAttribute)

Source from the content-addressed store, hash-verified

3713 * @returns {string} decoded string
3714 */
3715const decodeHtmlEntities = (str, isAttribute) => {
3716 if (!str.includes("&")) return str;
3717
3718 return str.replace(CHARACTER_REFERENCE_REGEXP, (match, offset, source) =>
3719 decodeOneReference(
3720 match,
3721 source.charCodeAt(offset + match.length),
3722 isAttribute
3723 )
3724 );
3725};
3726
3727/**
3728 * Like `decodeHtmlEntities`, but also returns a boundary map from the

Callers 4

getAttributesMapMethod · 0.85
parseMethod · 0.85
walkFunction · 0.85

Calls 2

decodeOneReferenceFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected