Permalink
Browse files

Merge pull request #54 from ai/unquote_function

Unquote arguments in custom CSS function
  • Loading branch information...
tj committed Mar 12, 2013
2 parents acaf1bc + 9317ca0 commit b739dc19e6e9f96b39593fb1e24faee062d30f0c
Showing with 4 additions and 4 deletions.
  1. +3 −2 lib/plugins/function.js
  2. +0 −1 lib/plugins/url.js
  3. +1 −1 test/fixtures/function.css
View
@@ -3,7 +3,8 @@
* Module dependencies.
*/
-var visit = require('../visit');
+var visit = require('../visit')
+ , utils = require('../utils');
/**
* Define custom function.
@@ -42,7 +43,7 @@ function func(declarations, name, func) {
declarations.forEach(function(decl){
if (!~decl.value.indexOf(name + '(')) return;
decl.value = decl.value.replace(regexp, function(_, args){
- args = args.split(/,\s*/);
+ args = args.split(/,\s*/).map(utils.stripQuotes);
return func.apply(decl, args);
});
});
View
@@ -25,7 +25,6 @@ module.exports = function(fn) {
return func({ url: url });
function url(path){
- path = utils.stripQuotes(path);
return 'url("' + fn(path) + '")';
};
};
@@ -1,4 +1,4 @@
@font-face {
- scr: fonts(a.woff,a.ttf, a.otf);
+ scr: fonts("a.woff",a.ttf, 'a.otf');
font-family: A
}

0 comments on commit b739dc1

Please sign in to comment.