cafe-utility 4.13.0 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -840,7 +840,9 @@ const htmlEntityMap = {
|
|
|
840
840
|
}
|
|
841
841
|
|
|
842
842
|
function decodeHtmlEntities(string) {
|
|
843
|
-
let buffer = string
|
|
843
|
+
let buffer = string
|
|
844
|
+
.replace(/&#(\d+);/g, (_, dec) => String.fromCharCode(dec))
|
|
845
|
+
.replace(/&#x(\d+);/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))
|
|
844
846
|
for (const key of Object.keys(htmlEntityMap)) {
|
|
845
847
|
buffer = buffer.split(key).join(htmlEntityMap[key])
|
|
846
848
|
}
|