mirror of
https://github.com/less/less.js.git
synced 2026-01-22 21:58:14 -05:00
when parsing a string, capture the content too
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
if (typeof(window) === 'undefined') { var tree = require(require('path').join(__dirname, '..', '..', 'less', 'tree')); }
|
||||
|
||||
tree.Quoted = function Quoted(value) { this.value = value };
|
||||
tree.Quoted = function Quoted(value, content) {
|
||||
this.value = value;
|
||||
this.content = content;
|
||||
};
|
||||
tree.Quoted.prototype = {
|
||||
toCSS: function () {
|
||||
var css = this.value;
|
||||
|
||||
@@ -196,8 +196,8 @@ less.parser = {
|
||||
var str;
|
||||
if (input[i] !== '"' && input[i] !== "'") return;
|
||||
|
||||
if (str = $(/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/g)) {
|
||||
return new(tree.Quoted)(str);
|
||||
if (str = $(/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/g)) {
|
||||
return new(tree.Quoted)(str[0], str[1] || str[2]);
|
||||
}
|
||||
},
|
||||
keyword: function () {
|
||||
|
||||
Reference in New Issue
Block a user