mirror of
https://github.com/tenrok/vue-meta.git
synced 2026-06-03 03:24:04 +03:00
refactor: combine escape info
This commit is contained in:
committed by
Alexander Lichter
parent
a9d46888ce
commit
2adba84e58
@@ -1,16 +1,9 @@
|
||||
import getMetaInfo from '../shared/getMetaInfo'
|
||||
import { isFunction } from '../shared/is-type'
|
||||
import { clientSequences } from '../shared/escaping'
|
||||
import updateClientMetaInfo from './updateClientMetaInfo'
|
||||
|
||||
export default function _refresh(options = {}) {
|
||||
const escapeSequences = [
|
||||
[/&/g, '\u0026'],
|
||||
[/</g, '\u003c'],
|
||||
[/>/g, '\u003e'],
|
||||
[/"/g, '\u0022'],
|
||||
[/'/g, '\u0027']
|
||||
]
|
||||
|
||||
/**
|
||||
* When called, will update the current meta info with new meta info.
|
||||
* Useful when updating meta info as the result of an asynchronous
|
||||
@@ -22,7 +15,7 @@ export default function _refresh(options = {}) {
|
||||
* @return {Object} - new meta info
|
||||
*/
|
||||
return function refresh() {
|
||||
const metaInfo = getMetaInfo(options, this.$root, escapeSequences)
|
||||
const metaInfo = getMetaInfo(options, this.$root, clientSequences)
|
||||
|
||||
const tags = updateClientMetaInfo(options, metaInfo)
|
||||
// emit "event" with new info
|
||||
|
||||
Reference in New Issue
Block a user