Skip to content

Commit

Permalink
fix($core): escape meta tags correctly (fix #2831) (#2832)
Browse files Browse the repository at this point in the history
Fixes #2831
  • Loading branch information
Sangeeth Sudheer committed May 17, 2021
1 parent 38e9863 commit b877b3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/@vuepress/core/lib/client/root-mixins/updateMeta.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import unionBy from 'lodash/unionBy'
import escape from 'escape-html'

export default {
// created will be called on both client and ssr
Expand Down Expand Up @@ -132,7 +133,7 @@ function renderPageMeta (meta) {
return meta.map(m => {
let res = `<meta`
Object.keys(m).forEach(key => {
res += ` ${key}="${m[key]}"`
res += ` ${key}="${escape(m[key])}"`
})
return res + `>`
}).join('\n ')
Expand Down

0 comments on commit b877b3b

Please sign in to comment.