[Pkg-javascript-commits] [less.js] 10/38: Fix inconsistancy with encoding base64 with data-uri - wasn't calling right function

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:27:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.2.0
in repository less.js.

commit e334d69be4031d3a4435e96277b21bcb835d284b
Author: Luke Page <luke.a.page at gmail.com>
Date:   Thu Jan 1 17:09:25 2015 +0000

    Fix inconsistancy with encoding base64 with data-uri - wasn't calling right function
---
 lib/less/functions/data-uri.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/less/functions/data-uri.js b/lib/less/functions/data-uri.js
index 2461a30..1c58651 100644
--- a/lib/less/functions/data-uri.js
+++ b/lib/less/functions/data-uri.js
@@ -68,8 +68,11 @@ module.exports = function(environment) {
             }
         }
 
-        buf = useBase64 ? buf.toString('base64')
-            : encodeURIComponent(buf);
+		if (useBase64 && !environment.encodeBase64) {
+			return fallback(this, filePathNode);
+		}
+
+        buf = useBase64 ? environment.encodeBase64(buf) : encodeURIComponent(buf);
 
         var uri = "data:" + mimetype + ',' + buf + fragment;
         return new URL(new Quoted('"' + uri + '"', uri, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list