Skip to content

Commit

Permalink
Mitigated super-linear backtracking in regex
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlui committed Nov 14, 2024
1 parent db406af commit 7cd5d92
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ const chatgpt = {

renderHTML(node) {
const reTags = /<([a-z\d]+)\b([^>]*)>([\s\S]*?)<\/\1>/g,
reAttributes = /(\S+)=['"]?((?:.(?!['"]?\s+\S+=|[>']))+.)['"]?/g,
reAttributes = /(\S+)=['"]?((?:.(?!['"]?\s+\S+=|[>']))+.)['"]?/g, // eslint-disable-line
nodeContent = node.childNodes;

// Preserve consecutive spaces + line breaks
Expand Down
Loading

0 comments on commit 7cd5d92

Please sign in to comment.