Fixes removing new lines from free text values.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 21 Jun 2015 10:09:36 +0000 (11:09 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 21 Jun 2015 10:12:42 +0000 (11:12 +0100)
lib/text/free-text-processor.js
test/fixtures/line-breaks-in-attributes.css

index 27a4aa4..dd31da8 100644 (file)
@@ -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);
index 5492aa6..d8b497d 100644 (file)
@@ -5,4 +5,4 @@ path")}
 title"] {
     background-image: url("my/very/long/\
 path")
-}
\ No newline at end of file
+}