Skip to content

Commit b877b3b

Browse files
author
Sangeeth Sudheer
authored
fix($core): escape meta tags correctly (fix #2831) (#2832)
Fixes #2831
1 parent 38e9863 commit b877b3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@vuepress/core/lib/client/root-mixins/updateMeta.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unionBy from 'lodash/unionBy'
2+
import escape from 'escape-html'
23

34
export default {
45
// created will be called on both client and ssr
@@ -132,7 +133,7 @@ function renderPageMeta (meta) {
132133
return meta.map(m => {
133134
let res = `<meta`
134135
Object.keys(m).forEach(key => {
135-
res += ` ${key}="${m[key]}"`
136+
res += ` ${key}="${escape(m[key])}"`
136137
})
137138
return res + `>`
138139
}).join('\n ')

0 commit comments

Comments
 (0)