Skip to content

Commit

Permalink
reST: Fixed exponential pattern (#1986)
Browse files Browse the repository at this point in the history
This fixes the exponential backtracking of the second `link` pattern.
  • Loading branch information
RunDevelopment authored Jul 20, 2019
1 parent 5d992fc commit 8b5d67a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Prism.languages.rest = {
}
},
{
pattern: /(?:\b[a-z\d](?:[_.:+]?[a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,
pattern: /(?:\b[a-z\d]+(?:[_.:+][a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,
alias: 'string',
inside: {
'punctuation': /^_?`|`$|`?_?_$/
Expand All @@ -202,4 +202,4 @@ Prism.languages.rest = {
pattern: /(^\s*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,
lookbehind: true
}
};
};
2 changes: 1 addition & 1 deletion components/prism-rest.min.js

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

0 comments on commit 8b5d67a

Please sign in to comment.