mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-21 09:20:33 +03:00
use different escape sequence on client side
This commit is contained in:
@@ -1,9 +1,24 @@
|
||||
import deepmerge from 'deepmerge'
|
||||
import escapeHTML from 'lodash.escape'
|
||||
import isPlainObject from 'lodash.isplainobject'
|
||||
import isArray from './isArray'
|
||||
import getComponentOption from './getComponentOption'
|
||||
|
||||
const escapeHTML = (str) => typeof window === 'undefined'
|
||||
// server-side escape sequence
|
||||
? String(str)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''')
|
||||
// client-side escape sequence
|
||||
: String(str)
|
||||
.replace(/&/g, '\u0026')
|
||||
.replace(/</g, '\u003c')
|
||||
.replace(/>/g, '\u003e')
|
||||
.replace(/"/g, '\u0022')
|
||||
.replace(/'/g, '\u0027')
|
||||
|
||||
export default function _getMetaInfo (options = {}) {
|
||||
const { keyName, tagIDKeyName } = options
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user