mirror of https://github.com/keeweb/keeweb.git
fix: convert space character to non-breaking space on password reveal
converts spaces and a few other characters empty characters into non-breaking spaces so that they'll render properly in the password field.
This commit is contained in:
commit
fb6aaff519
|
@ -8,6 +8,11 @@ class RandomNameGenerator {
|
|||
}
|
||||
|
||||
function charCodeToHtml(char) {
|
||||
// convert certain special chars like space into to non-breaking space
|
||||
// ' ' to &#nbsp;
|
||||
if (char === 32 || char === 8193 || char === 8239) {
|
||||
char = 160;
|
||||
}
|
||||
return Math.random() < 0.2 ? String.fromCharCode(char) : `&#x${char.toString(16)};`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue