Skip to content

Commit

Permalink
Remove escape characters when surrounded by whitespace
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ezekg committed Apr 28, 2016
1 parent 710ec43 commit 751db33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/serialiser.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Serialiser

unless typeof serialised is 'string' or serialised is null
throw new Error("serialiser #{node.type} didn\'t return a string")

serialised = serialised.replace /[\s\n]+\\[\s\n]+/g, ' '

serialised

Expand Down

0 comments on commit 751db33

Please sign in to comment.