Merge branch 'main' into exposing_consts

This commit is contained in:
raiyyan 2025-12-04 02:47:56 +05:30 committed by GitHub
commit f324ee35ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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];
}