Use String.replaceAll() instead of String.replace() with /g flag (S7781)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -325,7 +325,7 @@ function onInput(e) {
|
||||
*/
|
||||
function getTextWidth(text, e) {
|
||||
// Replace spaces with non-breaking spaces
|
||||
const processedText = text.replace(/ /g, "\u00a0");
|
||||
const processedText = text.replaceAll(" ", "\u00a0");
|
||||
const hiddenSpan = document.createElement("span");
|
||||
|
||||
hiddenSpan.textContent = processedText;
|
||||
|
||||
Reference in New Issue
Block a user