mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-15 16:37:13 +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:
1 parent
28b1938bd9
commit
6cecca6c4f
4 files changed
+37
-14
No files matched your search
@@ -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