Skip to content

Commit

Permalink
Merge pull request #3 from mvdschee/dev
Browse files Browse the repository at this point in the history
Fixed intrusive curly lines usage while flagging `<a>` 🐛
  • Loading branch information
mvdschee authored Dec 8, 2018
2 parents f71a910 + 14d6324 commit f550e69
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server/src/Patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = /<a(?:.)+?>/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) {
Expand Down

0 comments on commit f550e69

Please sign in to comment.