mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-07 22:38:51 +00:00
Fix CSS id for string prefixed with a digit
When encoding a string as a CSS identifier, we must add an underscore if the strings starts with a digit.
This commit is contained in:
@@ -106,6 +106,10 @@ String.prototype.asCSSIdentifier = function() {
|
||||
newString = newString.replace(re, escapeds[i]);
|
||||
}
|
||||
|
||||
if (/^\d+/.test(newString)) {
|
||||
newString = '_' + newString;
|
||||
}
|
||||
|
||||
return newString;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user