Skip to content

Commit 751db33

Browse files
committed
Remove escape characters when surrounded by whitespace
Quick and dirty fix for #47. This removes whitespace and newlines around an escape character when an escape character is present, replacing it with a single space.
1 parent 710ec43 commit 751db33

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/serialiser.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class Serialiser
3535

3636
unless typeof serialised is 'string' or serialised is null
3737
throw new Error("serialiser #{node.type} didn\'t return a string")
38+
39+
serialised = serialised.replace /[\s\n]+\\[\s\n]+/g, ' '
3840

3941
serialised
4042

0 commit comments

Comments
 (0)