File tree 1 file changed +3
-10
lines changed
src/client/app/composables
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,13 @@ export function useUpdateHead(route: Route, siteDataByRouteRef: Ref<SiteData>) {
17
17
// skip the first update.
18
18
isFirstUpdate = false
19
19
newTags . forEach ( ( tag ) => {
20
- const selector = toSelector ( tag [ 0 ] , tag [ 1 ] )
21
20
const headEl = createHeadElement ( tag )
22
- ; [ ... document . querySelectorAll ( selector ) ] . some ( ( el ) => {
21
+ for ( const el of document . head . children ) {
23
22
if ( el . isEqualNode ( headEl ) ) {
24
23
managedHeadElements . push ( el as HTMLElement )
25
- return true
24
+ return
26
25
}
27
- } )
26
+ }
28
27
} )
29
28
return
30
29
}
@@ -106,9 +105,3 @@ function isMetaDescription(headConfig: HeadConfig) {
106
105
function filterOutHeadDescription ( head : HeadConfig [ ] ) {
107
106
return head . filter ( ( h ) => ! isMetaDescription ( h ) )
108
107
}
109
-
110
- function toSelector ( tag : string , attrs : Record < string , string > ) {
111
- return `${ tag } ${ Object . keys ( attrs )
112
- . map ( ( key ) => `[${ key } ="${ attrs [ key ] . replace ( / ( [ " ' \\ ] ) / g, '\\$1' ) } "]` )
113
- . join ( '' ) } `
114
- }
You can’t perform that action at this time.
0 commit comments