From: Jakub Pawlowicz Date: Sun, 21 Jun 2015 10:09:36 +0000 (+0100) Subject: Fixes removing new lines from free text values. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=08e423072bcbc0cb5a86f8b529697950531788ef;p=clean-css.git Fixes removing new lines from free text values. --- diff --git a/lib/text/free-text-processor.js b/lib/text/free-text-processor.js index 27a4aa4d..dd31da83 100644 --- a/lib/text/free-text-processor.js +++ b/lib/text/free-text-processor.js @@ -49,8 +49,11 @@ function normalize(text, data, cursor) { var context = data.substring(lastOne + 1, cursor); - if (/\[[\w\d\-]+[\*\|\~\^\$]?=$/.test(context)) - text = text.replace(/\\\n|\\\r\n/g, ''); + if (/\[[\w\d\-]+[\*\|\~\^\$]?=$/.test(context)) { + text = text + .replace(/\\\n|\\\r\n/g, '') + .replace(/\n|\r\n/g, ''); + } if (/^['"][a-zA-Z][a-zA-Z\d\-_]+['"]$/.test(text) && !/format\($/.test(context)) { var isFont = /^(font|font\-family):/.test(context); diff --git a/test/fixtures/line-breaks-in-attributes.css b/test/fixtures/line-breaks-in-attributes.css index 5492aa69..d8b497d0 100644 --- a/test/fixtures/line-breaks-in-attributes.css +++ b/test/fixtures/line-breaks-in-attributes.css @@ -5,4 +5,4 @@ path")} title"] { background-image: url("my/very/long/\ path") -} \ No newline at end of file +}