From e9f5bf093f40e348d0a4f9eb84f25fdc9eb559c0 Mon Sep 17 00:00:00 2001 From: Sebastien Chopin Date: Mon, 15 May 2017 14:43:01 +0200 Subject: [PATCH] Fix issue #67 --- examples/basic/app.js | 6 +++++- src/client/updaters/updateTags.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/basic/app.js b/examples/basic/app.js index 52514f1..17ae83a 100644 --- a/examples/basic/app.js +++ b/examples/basic/app.js @@ -19,6 +19,10 @@ new Vue({ }, meta: [ { name: 'description', content: 'Hello', vmid: 'test' } - ] + ], + script: [ + { innerHTML: '{ "@context": "http://www.schema.org", "@type": "Organization" }', type: 'application/ld+json' } + ], + __dangerouslyDisableSanitizers: ['script'] }) }).$mount('#app') diff --git a/src/client/updaters/updateTags.js b/src/client/updaters/updateTags.js index ac9b389..0e6cd92 100644 --- a/src/client/updaters/updateTags.js +++ b/src/client/updaters/updateTags.js @@ -34,10 +34,10 @@ export default function _updateTags (options = {}) { if (tags && tags.length) { tags.forEach((tag) => { + if (type === '__dangerouslyDisableSanitizers') return const newElement = document.createElement(type) for (const attr in tag) { - console.log(type, attribute, attr) if (tag.hasOwnProperty(attr)) { if (attr === 'innerHTML') { newElement.innerHTML = tag.innerHTML