From 683dbd2be4a72a0251958cdbf9a548621aa3fffa 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 eea910e273..f605f81d32 100644 --- a/util.cpp +++ b/util.cpp @@ -220,11 +220,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;