chore(nuxt): remove unused code (#26319)

This commit is contained in:
Julien Huang 2024-03-17 22:27:43 +01:00 committed by GitHub
parent 523db1a197
commit 03f7b0941e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -75,24 +75,6 @@ export function createBuffer () {
}
}
const TRANSLATE_RE = /&(nbsp|amp|quot|lt|gt);/g
const NUMSTR_RE = /&#(\d+);/gi
export function decodeHtmlEntities (html: string) {
const translateDict = {
nbsp: ' ',
amp: '&',
quot: '"',
lt: '<',
gt: '>'
} as const
return html.replace(TRANSLATE_RE, function (_, entity: keyof typeof translateDict) {
return translateDict[entity]
}).replace(NUMSTR_RE, function (_, numStr: string) {
const num = parseInt(numStr, 10)
return String.fromCharCode(num)
})
}
/**
* helper for NuxtIsland to generate a correct array for scoped data
*/