]> source.dussan.org Git - vaadin-framework.git/commitdiff
fix Ticket #10506, remove quotes in url path 58/558/3
authorHaijian Wang <haijian@vaadin.com>
Wed, 2 Jan 2013 14:54:11 +0000 (16:54 +0200)
committerHaijian Wang <haijian@vaadin.com>
Wed, 2 Jan 2013 14:54:11 +0000 (16:54 +0200)
taking single quote into consideration

Change-Id: I966ffeba8a60c7c16980cca3dfa69935e0aca67b

theme-compiler/src/com/vaadin/sass/internal/visitor/ImportNodeHandler.java
theme-compiler/tests/resources/automatic/css/url-path.css [new file with mode: 0644]
theme-compiler/tests/resources/automatic/scss/foo/bar.scss [new file with mode: 0644]
theme-compiler/tests/resources/automatic/scss/url-path.scss [new file with mode: 0644]

index 1ba1072767d10fc62720a38db30300efbac79f62..67e6df6383d4290f830c7afb8b77ee37b3d0c61a 100644 (file)
@@ -100,7 +100,9 @@ public class ImportNodeHandler {
                 LexicalUnit value = ((RuleNode) child).getValue();
                 while (value != null) {
                     if (value.getLexicalUnitType() == LexicalUnit.SAC_URI) {
-                        String path = value.getStringValue();
+                        String path = value.getStringValue()
+                                .replaceAll("^\"|\"$", "")
+                                .replaceAll("^'|'$", "");
                         if (!path.startsWith("/") && !path.contains(":")) {
                             path = prefix + path;
                             path = StringUtil.cleanPath(path);
diff --git a/theme-compiler/tests/resources/automatic/css/url-path.css b/theme-compiler/tests/resources/automatic/css/url-path.css
new file mode 100644 (file)
index 0000000..1045948
--- /dev/null
@@ -0,0 +1,5 @@
+.bar {
+    background: url(foo/lorem.png);
+    background: url(foo/lorem.png);
+    background: url(foo/lorem.png);
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/scss/foo/bar.scss b/theme-compiler/tests/resources/automatic/scss/foo/bar.scss
new file mode 100644 (file)
index 0000000..326d342
--- /dev/null
@@ -0,0 +1,5 @@
+.bar {
+   background: url("lorem.png");
+   background: url('lorem.png');
+   background: url(lorem.png);
+}
\ No newline at end of file
diff --git a/theme-compiler/tests/resources/automatic/scss/url-path.scss b/theme-compiler/tests/resources/automatic/scss/url-path.scss
new file mode 100644 (file)
index 0000000..0cc954b
--- /dev/null
@@ -0,0 +1 @@
+@import "foo/bar.scss";
\ No newline at end of file