mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Fix for #198, with regexen, and urlencoding if the token is uppercase.
This commit is contained in:
committed by
Alexis Sellier
parent
0202b29f41
commit
d7cdc17cde
@@ -128,8 +128,10 @@ tree.functions = {
|
||||
str = quoted.value;
|
||||
|
||||
for (var i = 0; i < args.length; i++) {
|
||||
str = str.replace(/%s/, args[i].value)
|
||||
.replace(/%[da]/, args[i].toCSS());
|
||||
str = str.replace(/%[sda]/i, function(token) {
|
||||
var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
|
||||
return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
|
||||
});
|
||||
}
|
||||
str = str.replace(/%%/g, '%');
|
||||
return new(tree.Quoted)('"' + str + '"', str);
|
||||
|
||||
Reference in New Issue
Block a user