[Pkg-javascript-commits] [less.js] 206/285: Support urls begining // which are unquoted. Fixes #2238

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit ba3d24a352f17120364cccba21b875e3056f1143
Author: Luke Page <luke.a.page at gmail.com>
Date:   Tue Oct 21 13:01:01 2014 +0100

    Support urls begining // which are unquoted. Fixes #2238
---
 lib/less/parser/parser.js   | 5 +++--
 test/browser/css/urls.css   | 1 +
 test/browser/less/urls.less | 1 +
 test/css/urls.css           | 1 +
 test/less/urls.less         | 1 +
 test/sourcemaps/basic.json  | 2 +-
 6 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/less/parser/parser.js b/lib/less/parser/parser.js
index 099d346..c19ed92 100644
--- a/lib/less/parser/parser.js
+++ b/lib/less/parser/parser.js
@@ -389,12 +389,13 @@ var Parser = function Parser(context, imports, fileInfo) {
                 url: function () {
                     var value, index = parserInput.i;
 
+                    parserInput.autoCommentAbsorb = false;
+
                     if (parserInput.currentChar() !== 'u' || !parserInput.$re(/^url\(/)) {
+                        parserInput.autoCommentAbsorb = true;
                         return;
                     }
 
-                    parserInput.autoCommentAbsorb = false;
-
                     value = this.quoted() || this.variable() ||
                             parserInput.$re(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/) || "";
 
diff --git a/test/browser/css/urls.css b/test/browser/css/urls.css
index c151051..f55542e 100644
--- a/test/browser/css/urls.css
+++ b/test/browser/css/urls.css
@@ -9,6 +9,7 @@
 @font-face {
   src: url("/fonts/garamond-pro.ttf");
   src: local(Futura-Medium), url(http://localhost:8081/test/browser/less/fonts.svg#MyGeometricModern) format("svg");
+  not-a-comment: url(//z);
 }
 #shorthands {
   background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
diff --git a/test/browser/less/urls.less b/test/browser/less/urls.less
index 596e5e7..ec478fe 100644
--- a/test/browser/less/urls.less
+++ b/test/browser/less/urls.less
@@ -4,6 +4,7 @@
   src: url("/fonts/garamond-pro.ttf");
   src: local(Futura-Medium),
        url(fonts.svg#MyGeometricModern) format("svg");
+  not-a-comment: url(//z);
 }
 #shorthands {
   background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
diff --git a/test/css/urls.css b/test/css/urls.css
index 1604251..fac9b85 100644
--- a/test/css/urls.css
+++ b/test/css/urls.css
@@ -4,6 +4,7 @@
 @font-face {
   src: url("/fonts/garamond-pro.ttf");
   src: local(Futura-Medium), url(fonts.svg#MyGeometricModern) format("svg");
+  not-a-comment: url(//z);
 }
 #shorthands {
   background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
diff --git a/test/less/urls.less b/test/less/urls.less
index 9569415..73c807c 100644
--- a/test/less/urls.less
+++ b/test/less/urls.less
@@ -2,6 +2,7 @@
   src: url("/fonts/garamond-pro.ttf");
   src: local(Futura-Medium),
        url(fonts.svg#MyGeometricModern) format("svg");
+  not-a-comment: url(//z);
 }
 #shorthands {
   background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
diff --git a/test/sourcemaps/basic.json b/test/sourcemaps/basic.json
index 51372f3..add9ccf 100644
--- a/test/sourcemaps/basic.json
+++ b/test/sourcemaps/basic.json
@@ -1 +1 @@
-{"version":3,"sources":["testweb/sourcemaps/basic.less","testweb/sourcemaps/imported.css"],"names":[],"mappings":"AAMA;EACE,YAAA;EAJA,UAAA;EAWA,iBAAA;EALA,WAAA;EACA,iBAAA;;AAJF,EASE;AATF,EASM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;EAGA,UAAA;;AALN;AAAI;AAUJ;EATE,iBAAA;;AADF,EAEE;AAFE,EAEF;AAFF,EAEM;AAFF,EAEE;AAQN,OARE;AAQF,OARM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAFA;AAEF,EAFF,GAEI,KAF [...]
\ No newline at end of file
+{"version":3,"file":"sourcemaps/basic.css","sources":["testweb/sourcemaps/basic.less","testweb/sourcemaps/imported.css"],"names":[],"mappings":"AAMA;EACE,YAAA;EAJA,UAAA;EAWA,iBAAA;EALA,WAAA;EACA,iBAAA;;AAJF,EASE;AATF,EASM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAFE,GAEA,KAFJ;AAEE,EAFE,GAEA,KAFA;EAGA,UAAA;;AALN;AAAI;AAUJ;EATE,iBAAA;;AADF,EAEE;AAFE,EAEF;AAFF,EAEM;AAFF,EAEE;AAQN,OARE;AAQF,OARM;EACF,gBAAA;;AACA,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFJ;AAEE,EAFF,GAEI,KAFA;AAEF,EAF [...]
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list