(str, isAttribute)
| 3713 | * @returns {string} decoded string |
| 3714 | */ |
| 3715 | const 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 |
no test coverage detected