1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-21 03:39:43 +00:00

Fix suffix does not work for base64 operators (#8574)

* Fix suffix does not work for base64 operators

* Remove console.log
This commit is contained in:
Leilei332 2024-09-07 02:40:05 +08:00 committed by GitHub
parent f0cb57fad8
commit dcf63b75fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,8 +18,8 @@ Export our filter functions
exports.decodebase64 = function(source,operator,options) {
var results = [];
var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1;
var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1;
var binary = operator.suffixes && operator.suffixes[0].indexOf("binary") !== -1;
var urlsafe = operator.suffixes && operator.suffixes[0].indexOf("urlsafe") !== -1;
source(function(tiddler,title) {
results.push($tw.utils.base64Decode(title,binary,urlsafe));
});
@ -28,8 +28,8 @@ exports.decodebase64 = function(source,operator,options) {
exports.encodebase64 = function(source,operator,options) {
var results = [];
var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1;
var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1;
var binary = operator.suffixes && operator.suffixes[0].indexOf("binary") !== -1;
var urlsafe = operator.suffixes && operator.suffixes[0].indexOf("urlsafe") !== -1;
source(function(tiddler,title) {
results.push($tw.utils.base64Encode(title,binary,urlsafe));
});