fix: bug where newlines aren't escaped properly

This commit is contained in:
Jacob Kim 2025-08-05 17:46:42 -07:00
parent b2744c159a
commit ea5859b3da

View file

@ -32,7 +32,10 @@ export function escapeForSVG(text: string): string {
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&apos;");
.replace(/'/g, "&apos;")
.replace(/\n/g, "\\n") // newlines
.replace(/\t/g, "\\t") // tabs
.replace(/\r/g, "\\r"); // carriage returns
}
export function kebabOfStr(str: string): string {