We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fbeb3f commit dbb5581Copy full SHA for dbb5581
packages/unhead/src/plugins/xss.ts
@@ -4,7 +4,7 @@ export default defineHeadPlugin({
4
hooks: {
5
'tags:afterResolve': function (ctx) {
6
for (const tag of ctx.tags) {
7
- if (tag.innerHTML) {
+ if (typeof tag.innerHTML === 'string') {
8
if (tag.innerHTML && ['application/ld+json', 'application/json'].includes(tag.props.type))
9
// ensure </script> tags get encoded, this is only for JSON, it will break HTML if used
10
{ tag.innerHTML = tag.innerHTML.replace(/</g, '\\u003C') }
@@ -15,6 +15,7 @@ export default defineHeadPlugin({
15
.replace(new RegExp(`</${tag.tag}`, 'g'), `<\\/${tag.tag}`)
16
}
17
18
+ // TODO delete innerHTML otherwise
19
20
},
21
0 commit comments