mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-04-26 16:51:30 +00:00
Add charcode operator to make it easier to generate strings containing control characters
Avoids some confusing hacks. @saqimtiaz I'm guessing you might have already done something like this?
This commit is contained in:
@@ -172,4 +172,14 @@ exports.pad = function(source,operator,options) {
|
||||
return results;
|
||||
}
|
||||
|
||||
exports.charcode = function(source,operator,options) {
|
||||
var chars = [];
|
||||
$tw.utils.each(operator.operands,function(operand) {
|
||||
if(operand !== "") {
|
||||
chars.push(String.fromCharCode($tw.utils.parseInt(operand)));
|
||||
}
|
||||
});
|
||||
return [chars.join("")];
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user