mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-24 10:40:35 +03:00
Improve __dangerouslyDisableSanitizers
This commit is contained in:
@@ -33,6 +33,7 @@ export default function _updateClientMetaInfo (options = {}) {
|
|||||||
case 'titleChunk':
|
case 'titleChunk':
|
||||||
case 'titleTemplate':
|
case 'titleTemplate':
|
||||||
case 'changed':
|
case 'changed':
|
||||||
|
case '__dangerouslyDisableSanitizers':
|
||||||
break
|
break
|
||||||
// catch-all update tags
|
// catch-all update tags
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ export default function _updateTags (options = {}) {
|
|||||||
|
|
||||||
if (tags && tags.length) {
|
if (tags && tags.length) {
|
||||||
tags.forEach((tag) => {
|
tags.forEach((tag) => {
|
||||||
if (type === '__dangerouslyDisableSanitizers') return
|
|
||||||
const newElement = document.createElement(type)
|
const newElement = document.createElement(type)
|
||||||
|
|
||||||
for (const attr in tag) {
|
for (const attr in tag) {
|
||||||
|
|||||||
@@ -97,6 +97,10 @@ export default function _getMetaInfo (options = {}) {
|
|||||||
const ref = info.__dangerouslyDisableSanitizers
|
const ref = info.__dangerouslyDisableSanitizers
|
||||||
const isDisabled = ref && ref.indexOf(key) > -1
|
const isDisabled = ref && ref.indexOf(key) > -1
|
||||||
const val = info[key]
|
const val = info[key]
|
||||||
|
escaped[key] = val;
|
||||||
|
if (key === '__dangerouslyDisableSanitizers') {
|
||||||
|
return escaped
|
||||||
|
}
|
||||||
if (!isDisabled) {
|
if (!isDisabled) {
|
||||||
if (typeof val === 'string') {
|
if (typeof val === 'string') {
|
||||||
escaped[key] = escapeHTML(val)
|
escaped[key] = escapeHTML(val)
|
||||||
|
|||||||
Reference in New Issue
Block a user