Skip to content

Commit b3e7bdb

Browse files
authored
Merge pull request scratchblocks#576 from LuYifei2011/fix-escape-character-stringify
Fix escape character handling in stringify method of Label class
2 parents 83d654f + 97e84bd commit b3e7bdb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

syntax/model.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export class Label {
3939
if (this.value === "<" || this.value === ">") {
4040
return this.value
4141
}
42-
return this.value.replace(/([<>[\](){}])/g, "\\$1")
42+
return this.value
43+
.replace(/([<>[\](){}\\])/g, "\\$1")
44+
.replace(/:{2,}/g, m => ":" + "\\:".repeat(m.length - 1))
4345
}
4446
}
4547

0 commit comments

Comments
 (0)