Skip to content

Commit

Permalink
fix(javascript/typescript) fix poly backtracking issue
Browse files Browse the repository at this point in the history
- Fix poly backtracking issue in gnarly `()` counting regex
  • Loading branch information
joshgoebel committed Dec 3, 2020
1 parent fdec037 commit d9f1cdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/languages/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ export default function(hljs) {
'[^()]*(\\(' +
'[^()]*(\\(' +
'[^()]*' +
'\\))*[^()]*' +
'\\))*[^()]*' +
'\\)[^()]*)*' +
'\\)[^()]*)*' +
'\\)|' + hljs.UNDERSCORE_IDENT_RE + ')\\s*=>',
returnBegin: true,
end: '\\s*=>',
Expand Down Expand Up @@ -373,8 +373,8 @@ export default function(hljs) {
'[^()]*(\\(' +
'[^()]*(\\(' +
'[^()]*' +
'\\))*[^()]*' +
'\\))*[^()]*' +
'\\)[^()]*)*' +
'\\)[^()]*)*' +
'\\)\\s*\\{', // end parens
returnBegin:true,
contains: [
Expand Down

0 comments on commit d9f1cdb

Please sign in to comment.