mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
chore(nuxt): remove unused code (#26319)
This commit is contained in:
parent
523db1a197
commit
03f7b0941e
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user