mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-21 16:55:57 +00:00
fix(ui-templates): escape inline scripts correctly in ui templates
This commit is contained in:
parent
97ec3143a5
commit
39c2b0a2c4
@ -157,8 +157,8 @@ export const RenderPlugin = () => {
|
|||||||
`const props = defineProps(${props})`,
|
`const props = defineProps(${props})`,
|
||||||
title && 'useHead(' + genObjectFromRawEntries([
|
title && 'useHead(' + genObjectFromRawEntries([
|
||||||
['title', `\`${title}\``],
|
['title', `\`${title}\``],
|
||||||
['script', inlineScripts.map(s => ({ children: `\`${s}\`` }))],
|
['script', inlineScripts.map(s => ({ children: `\`${s.replace(/[`$]/g, '\\$&')}\`` }))],
|
||||||
['style', [{ children: `\`${globalStyles}\`` }]],
|
['style', [{ children: `\`${globalStyles.replace(/[`$]/g, '\\$&')}\`` }]],
|
||||||
]) + ')',
|
]) + ')',
|
||||||
'</script>',
|
'</script>',
|
||||||
'<template>',
|
'<template>',
|
||||||
|
Loading…
Reference in New Issue
Block a user