Merge remote-tracking branch 'origin/main' into overlapping-ranges-fix

This commit is contained in:
junlu592 2025-12-02 11:40:39 +01:00
commit 17c63491d9

View file

@ -4,7 +4,12 @@
import { getRange, getSelection } from "./cross-browser";
function wrappedExceptForWhitespace(text: string, front: string, back: string): string {
const match = text.match(/^(\s*)([^]*?)(\s*)$/)!;
const normalizedText = text
.replace(/ /g, " ")
.replace(/ /g, " ")
.replace(/\u00A0/g, " ");
const match = normalizedText.match(/^(\s*)([^]*?)(\s*)$/)!;
return match[1] + front + match[2] + back + match[3];
}