From 14d632462b57772eaee621ace3838aa7b310add8 Mon Sep 17 00:00:00 2001 From: Max van der Schee Date: Sat, 8 Dec 2018 17:10:27 +0100 Subject: [PATCH] Fixed intrusive curly lines usage while flagging `` :bug: --- server/src/Patterns.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/src/Patterns.ts b/server/src/Patterns.ts index d84a826..96e824b 100644 --- a/server/src/Patterns.ts +++ b/server/src/Patterns.ts @@ -47,13 +47,17 @@ export async function validateSpan(m: RegExpExecArray) { } export async function validateA(m: RegExpExecArray) { + let aRegEx: RegExpExecArray; + let oldRegEx: RegExpExecArray = m; let filteredString = m[0].replace(/<(?:\s|\S)+?>/ig, ""); - if (!/(?:\S+?)/ig.test(filteredString)) { - return { - meta: m, - mess: 'Provide a descriptive text in between the tags' - }; - } + if (!/(?:\S+?)/ig.test(filteredString)) { + aRegEx = //i.exec(oldRegEx[0]); + aRegEx.index = oldRegEx.index; + return { + meta: aRegEx, + mess: 'Provide a descriptive text in between the tags' + }; + } } export async function validateImg(m: RegExpExecArray) {