Skip to content

Commit

Permalink
fixing linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas committed Dec 9, 2024
1 parent dc65de1 commit e57d995
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ export function safeHtmlSpan(possiblyHtmlString: string) {

export function removeHTMLTags(str: string): string {
let previous;
let newstr = str;
do {
previous = str;
str = str.replace(/<[^>]*>/g, '');
} while (str !== previous);
return str;
previous = newstr;
newstr = newstr.replace(/<[^>]*>/g, '');

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with '<' and with many repetitions of '<'.
} while (newstr !== previous);
return newstr;
}

export function isJsonString(str: string): boolean {
Expand Down

0 comments on commit e57d995

Please sign in to comment.