From 751db33f4f0063451b9ed307c74b6ea3889cb53a Mon Sep 17 00:00:00 2001 From: Ezekiel Gabrielse Date: Wed, 27 Apr 2016 18:19:28 -0500 Subject: [PATCH] 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. --- src/serialiser.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/serialiser.coffee b/src/serialiser.coffee index aa2b58c..834d13f 100644 --- a/src/serialiser.coffee +++ b/src/serialiser.coffee @@ -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