diff --git a/src/js/optionsMacro.js b/src/js/optionsMacro.js index cb7d4b0e0e4621bae2aa2c32cbc0e97b3e9c2b55..6731400c9142fee8e4c3a355644e9eb7a8360cfd 100644 --- a/src/js/optionsMacro.js +++ b/src/js/optionsMacro.js @@ -93,7 +93,9 @@ Macro.add('options', { found = true; found_index = i; } - } else if (this.payload[i].name === 'comment') {} else if (this.payload[i].name === 'optionif') {} else { + } else if (this.payload[i].name === 'comment') { + } else if (this.payload[i].name === 'optionif') { + } else { throw new Error("Only valid tag is 'option' inside 'options'"); } } @@ -165,12 +167,13 @@ Macro.add('options', { } } jQuery(this.output).wiki( - `<span class="optionMacro ${currentOptionIsNumber ? 'optionMacroNumber' : ''}">` + - `<span class="optionDescription">${title} ${description} </span>` + - `<span class="optionValue">${output}</span>` + - `${comment ? '<span class="optionComment">//${comment}//</span>' : ''}` + - `</span>`); - } catch (ex) { + '<span class="optionMacro ' + (currentOptionIsNumber ? 'optionMacroNumber' : '') + '">' + + '<span class="optionDescription">' + title + ' ' + description + "</span>" + + '<span class="optionValue">' + output + "</span>" + + (comment ? '<span class="optionComment">//' + comment + "//</span>" : '') + + '</span>'); + } + catch (ex) { return this.error('bad options expression: ' + ex.message); } }