when parsing a string, capture the content too

browser
cloudhead 15 years ago
parent 00279d8a06
commit cd5bddff99

@ -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 () {

Loading…
Cancel
Save