From cd5bddff99629aa9d13ca0150ecb010924992981 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 5 Mar 2010 14:55:21 -0500 Subject: [PATCH] when parsing a string, capture the content too --- lib/less/node/quoted.js | 5 ++++- lib/less/parser.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/less/node/quoted.js b/lib/less/node/quoted.js index 163c2db..ba16fc7 100644 --- a/lib/less/node/quoted.js +++ b/lib/less/node/quoted.js @@ -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; diff --git a/lib/less/parser.js b/lib/less/parser.js index 53e718e..cdd7100 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -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 () {