2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-16 09:20:33 +03:00

Improve __dangerouslyDisableSanitizers

This commit is contained in:
Sebastien Chopin
2017-05-15 14:48:32 +02:00
parent 456789a9f0
commit b3e9a4cab1
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -33,6 +33,7 @@ export default function _updateClientMetaInfo (options = {}) {
case 'titleChunk':
case 'titleTemplate':
case 'changed':
case '__dangerouslyDisableSanitizers':
break
// catch-all update tags
default:
-1
View File
@@ -34,7 +34,6 @@ 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) {
+4
View File
@@ -97,6 +97,10 @@ export default function _getMetaInfo (options = {}) {
const ref = info.__dangerouslyDisableSanitizers
const isDisabled = ref && ref.indexOf(key) > -1
const val = info[key]
escaped[key] = val;
if (key === '__dangerouslyDisableSanitizers') {
return escaped
}
if (!isDisabled) {
if (typeof val === 'string') {
escaped[key] = escapeHTML(val)