fix: bug where newlines aren't escaped properly
This commit is contained in:
parent
b2744c159a
commit
ea5859b3da
1 changed files with 4 additions and 1 deletions
|
|
@ -32,7 +32,10 @@ export function escapeForSVG(text: string): string {
|
|||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """)
|
||||
.replace(/'/g, "'");
|
||||
.replace(/'/g, "'")
|
||||
.replace(/\n/g, "\\n") // newlines
|
||||
.replace(/\t/g, "\\t") // tabs
|
||||
.replace(/\r/g, "\\r"); // carriage returns
|
||||
}
|
||||
|
||||
export function kebabOfStr(str: string): string {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue