Skip to content

Commit c9d6312

Browse files
committed
Remove whitespace and escape characters
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 c9d6312

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)