From dda11812f4c7461d6164c826ce0751654287f7da Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Mon, 15 Jun 2015 02:44:50 +0200 Subject: [PATCH] Fix string output normalization for linefeeds Fixes https://github.com/sass/libsass/issues/1230 --- util.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util.cpp b/util.cpp index 831a4b7cd9..778f3241d6 100644 --- a/util.cpp +++ b/util.cpp @@ -216,11 +216,14 @@ namespace Sass { string string_to_output(const string& str) { string out(""); + bool lf = false; for (auto i : str) { if (i == 10) { out += ' '; - } else { + lf = true; + } else if (!(lf && isspace(i))) { out += i; + lf = false; } } return out;