fix tag values with whitespace causing css bugs (#9637)

This commit is contained in:
Kyℓe Hensel
2023-05-24 09:21:41 +12:00
committed by GitHub
parent 25669b700a
commit 077d9a5105
2 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -159,7 +159,12 @@ export function svgTagClasses() {
classes.push('tag-wikidata');
}
return classes.join(' ').trim();
// ensure that classes for tags keys/values with special characters like spaces
// are not added to the DOM, because it can cause bizarre issues (#9448)
return classes
.filter(klass => /^[-_a-z0-9]+$/.test(klass))
.join(' ')
.trim();
};