clean up temp enable flag

This commit is contained in:
Steve-Mcl 2021-10-04 23:34:38 +01:00
parent f0b03b4ada
commit c0a256306b
1 changed files with 2 additions and 3 deletions

View File

@ -22,7 +22,6 @@ RED.utils = (function() {
return renderMarkdown(txt);
}
let enable = true;
const descriptionList = {
name: 'descriptionList',
level: 'block', // Is this a block-level or inline-level tokenizer?
@ -52,11 +51,11 @@ RED.utils = (function() {
name: 'description',
level: 'inline', // Is this a block-level or inline-level tokenizer?
start(src) {
if (!enable) return null
if (!src) return null
src.match(/:/)?.index; // Hint to Marked.js to stop and check for a match
},
tokenizer(src, tokens) {
if (!enable) return null;
if (!src) return null;
const rule = /^:([^:\n]+)\(([^:\n]+)\).*?:([^:\n]*)(?:\n|$)/; // Regex for the complete token
const match = rule.exec(src);
if (match) {