@@ -444,10 +444,18 @@ export function getResource(
444
444
matcher = 'meta[charset]' ;
445
445
} else if ( typeof content === 'string' ) {
446
446
if ( typeof httpEquiv === 'string' ) {
447
- matcher = `meta[http-equiv="${ httpEquiv } "][content="${ content } "]` ;
447
+ matcher = `meta[http-equiv="${ escapeSelectorAttributeValueInsideDoubleQuotes (
448
+ httpEquiv ,
449
+ ) } "][content="${ escapeSelectorAttributeValueInsideDoubleQuotes (
450
+ content ,
451
+ ) } "]`;
448
452
} else if ( typeof property === 'string' ) {
449
453
propertyString = property ;
450
- matcher = `meta[property="${ property } "][content="${ content } "]` ;
454
+ matcher = `meta[property="${ escapeSelectorAttributeValueInsideDoubleQuotes (
455
+ property ,
456
+ ) } "][content="${ escapeSelectorAttributeValueInsideDoubleQuotes (
457
+ content ,
458
+ ) } "]`;
451
459
452
460
const parentPropertyPath = property
453
461
. split ( ':' )
@@ -460,9 +468,17 @@ export function getResource(
460
468
matcher = parentResource . matcher + matcher ;
461
469
}
462
470
} else if ( typeof name === 'string' ) {
463
- matcher = `meta[name="${ name } "][content="${ content } "]` ;
471
+ matcher = `meta[name="${ escapeSelectorAttributeValueInsideDoubleQuotes (
472
+ name ,
473
+ ) } "][content="${ escapeSelectorAttributeValueInsideDoubleQuotes (
474
+ content ,
475
+ ) } "]`;
464
476
} else if ( typeof itemProp === 'string' ) {
465
- matcher = `meta[itemprop="${ itemProp } "][content="${ content } "]` ;
477
+ matcher = `meta[itemprop="${ escapeSelectorAttributeValueInsideDoubleQuotes (
478
+ itemProp ,
479
+ ) } "][content="${ escapeSelectorAttributeValueInsideDoubleQuotes (
480
+ content ,
481
+ ) } "]`;
466
482
}
467
483
}
468
484
if ( matcher ) {
0 commit comments