Skip to content

Commit

Permalink
Fix catastrophic backtracking regex issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitgeist87 committed Feb 12, 2016
1 parent 99c30e4 commit ab65be2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/prism-bash.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
inside: insideString
},
{
pattern: /("|')(?:\\?[\s\S])*?\1/g,
pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g,
inside: insideString
}
],
Expand Down
2 changes: 1 addition & 1 deletion components/prism-bash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Prism.languages.insertBefore('javascript', 'keyword', {

Prism.languages.insertBefore('javascript', 'class-name', {
'template-string': {
pattern: /`(?:\\`|\\?[^`])*`/,
pattern: /`(?:\\\\|\\?[^\\])*?`/,
inside: {
'interpolation': {
pattern: /\$\{[^}]+\}/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-javascript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ Prism.languages.insertBefore('javascript', 'keyword', {

Prism.languages.insertBefore('javascript', 'class-name', {
'template-string': {
pattern: /`(?:\\`|\\?[^`])*`/,
pattern: /`(?:\\\\|\\?[^\\])*?`/,
inside: {
'interpolation': {
pattern: /\$\{[^}]+\}/,
Expand Down

0 comments on commit ab65be2

Please sign in to comment.