Skip to content

Commit

Permalink
enhance: rewrite regex for perf
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelgerber committed Nov 18, 2023
1 parent 0352b27 commit 1c582da
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ interface OpenHtmlTag {
fullTag: string // e.g. "<a href='https://ourworldindata.org'>"
}

const HTML_OPENING_CLOSING_TAG_REGEX = /<(\/?)([A-Za-z]+)[^>]*>/g
const HTML_OPENING_CLOSING_TAG_REGEX = /<(\/?)([A-Za-z]+)( [^<>]*)?>/g

function startsWithNewline(text: string): boolean {
return /^\n/.test(text)
Expand Down

0 comments on commit 1c582da

Please sign in to comment.