Skip to content

Commit 5654685

Browse files
committed
fix(client): fix wrong attrs selector when loading head tags (close vuepress#426)
1 parent 3c53af0 commit 5654685

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

packages/@vuepress/client/src/composables/updateHead.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,17 @@ export const queryHeadTag = ([
9999
attrs,
100100
content = '',
101101
]: HeadConfig): HTMLElement | null => {
102-
const attrsSelector = Object.entries(attrs).map(([key, value]) => {
103-
if (isString(value)) {
104-
return `[${key}="${value}"]`
105-
}
106-
107-
if (value === true) {
108-
return `[${key}]`
109-
}
110-
111-
return ''
112-
})
102+
const attrsSelector = Object.entries(attrs)
103+
.map(([key, value]) => {
104+
if (isString(value)) {
105+
return `[${key}="${value}"]`
106+
}
107+
if (value === true) {
108+
return `[${key}]`
109+
}
110+
return ''
111+
})
112+
.join('')
113113

114114
const selector = `head > ${tagName}${attrsSelector}`
115115
const tags = Array.from(document.querySelectorAll<HTMLElement>(selector))

0 commit comments

Comments
 (0)