fix grunt errors

This commit is contained in:
Steve-Mcl 2021-10-04 23:52:55 +01:00
parent aa1721ab3d
commit 8a2e74b3b8
1 changed files with 8 additions and 6 deletions

View File

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