From 51f3843c77fd4e84867d3f97f5d01e508805fe92 Mon Sep 17 00:00:00 2001 From: Robert Hamel Date: Tue, 31 Jul 2018 13:50:09 -0400 Subject: [PATCH 1/2] fix(meta): strip any html from meta title, if present closes #688 --- lib/app/root-mixins/updateMeta.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/app/root-mixins/updateMeta.js b/lib/app/root-mixins/updateMeta.js index ff2703acfe..de8e4bca5c 100644 --- a/lib/app/root-mixins/updateMeta.js +++ b/lib/app/root-mixins/updateMeta.js @@ -12,6 +12,10 @@ export default { this.currentMetaTags = new Set() const updateMeta = () => { + const title = this.$title.match(/\<.*\/\>/) + ? this.$title.replace(/^(\<.*\/\>)/, '') + : this.$title + document.title = title document.title = this.$title document.documentElement.lang = this.$lang const userMeta = this.$page.frontmatter.meta || [] From 37c98713b5ad0567669de4b8d649bc444ecbf4b0 Mon Sep 17 00:00:00 2001 From: Robert Hamel Date: Tue, 31 Jul 2018 14:02:13 -0400 Subject: [PATCH 2/2] fix(meta): remove duplicate assignment --- lib/app/root-mixins/updateMeta.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/app/root-mixins/updateMeta.js b/lib/app/root-mixins/updateMeta.js index de8e4bca5c..9522722b59 100644 --- a/lib/app/root-mixins/updateMeta.js +++ b/lib/app/root-mixins/updateMeta.js @@ -16,7 +16,6 @@ export default { ? this.$title.replace(/^(\<.*\/\>)/, '') : this.$title document.title = title - document.title = this.$title document.documentElement.lang = this.$lang const userMeta = this.$page.frontmatter.meta || [] const meta = userMeta.slice(0)