Refactor the way of symbols was handled, now compatible with "monks enhanced journal".

This commit is contained in:
Vlyan
2022-04-19 19:27:42 +02:00
parent 93e2bd23f8
commit 597c5a0b49
25 changed files with 38 additions and 90 deletions

View File

@@ -47,7 +47,7 @@ export const RegisterHandlebars = function () {
/* ------------------------------------ */
/* Utility */
/* ------------------------------------ */
// Json - Display a object in textarea (for debug)
// Json - Display an object in textarea (for debug)
Handlebars.registerHelper("json", function (...objects) {
objects.pop(); // remove this function call
return new Handlebars.SafeString(objects.map((e) => `<textarea>${JSON.stringify(e)}</textarea>`));
@@ -64,6 +64,11 @@ export const RegisterHandlebars = function () {
return objects.join("");
});
// enrichHTML
Handlebars.registerHelper("enrichHTML", function (text, options = {}) {
return TextEditor.enrichHTML(text, options);
});
// Add a setter
Handlebars.registerHelper("setVar", function (varName, varValue, options) {
options.data.root[varName] = varValue;