From e65548aa329b7cb6324a1db1b686ca861788b1e7 Mon Sep 17 00:00:00 2001 From: Skriv <skrivelese@gmail.com> Date: Wed, 27 Mar 2019 20:47:56 +0100 Subject: [PATCH] template literals --- src/js/textInput.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/js/textInput.js b/src/js/textInput.js index 9d352d28226..ba89308e4e9 100644 --- a/src/js/textInput.js +++ b/src/js/textInput.js @@ -7,7 +7,7 @@ Macro.add("textinput", { const errors = []; if (this.args.length < 1) { errors.push("variable name"); } if (this.args.length < 2) { errors.push("default value"); } - return this.error("no " + errors.join(" or ") + " specified"); + return this.error(`no ${errors.join(" or ")} specified`); } // Ensure that the variable name argument is a string. @@ -19,7 +19,7 @@ Macro.add("textinput", { // Try to ensure that we receive the variable's name (incl. sigil), not its value. if (varName[0] !== "$" && varName[0] !== "_") { - return this.error("variable name '" + varName + "' is missing its sigil ($ or _)"); + return this.error(`variable name '${varName}' is missing its sigil ($ or _)`); } const that = this; @@ -36,8 +36,9 @@ Macro.add("textinput", { .addClass("macro-textarea") // "hijack" the .macro-textarea class .on("input", function() { Wikifier.setValue(varName, this.value); - if (that.payload[0].contents !== "") + if (that.payload[0].contents !== "") { Wikifier.wikifyEval(that.payload[0].contents.trim()); + } }) .appendTo(this.output); -- GitLab