mirror of
https://github.com/less/less.js.git
synced 2026-02-08 22:15:04 -05:00
added base 64 encoding for rhino, fixes urls.less test case
This commit is contained in:
4
lib/less/encoder.js
Normal file
4
lib/less/encoder.js
Normal file
@@ -0,0 +1,4 @@
|
||||
// base64 encoder implementation for node
|
||||
exports.encodeBase64 = function(str) {
|
||||
return new Buffer(str).toString('base64');
|
||||
};
|
||||
@@ -579,9 +579,8 @@ tree.functions = {
|
||||
'<rect ' + rectangleDimension + ' fill="url(#gradient)" /></svg>';
|
||||
|
||||
if (useBase64) {
|
||||
// only works in node, needs interface to what is supported in environment
|
||||
try {
|
||||
returner = new Buffer(returner).toString('base64');
|
||||
returner = require('./encoder').encodeBase64(returner); // TODO browser implementation
|
||||
} catch(e) {
|
||||
useBase64 = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user