Skip to content

Commit

Permalink
Git: Regexp optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Oct 22, 2017
1 parent f26197a commit b9483b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Prism.languages.git = {
/*
* a string (double and simple quote)
*/
'string': /("|')(\\?.)*?\1/m,
'string': /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,

/*
* a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters
Expand All @@ -35,7 +35,7 @@ Prism.languages.git = {
* $ git diff --cached
* $ git log -p
*/
'parameter': /\s(--|-)\w+/m
'parameter': /\s--?\w+/m
}
},

Expand Down
2 changes: 1 addition & 1 deletion components/prism-git.min.js

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

0 comments on commit b9483b9

Please sign in to comment.