Skip to content

Commit

Permalink
nginx: Made some patterns greedy (#3230)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Dec 3, 2021
1 parent 8ecef30 commit 7b72e0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion components/prism-nginx.js
Expand Up @@ -5,7 +5,8 @@
Prism.languages.nginx = {
'comment': {
pattern: /(^|[\s{};])#.*/,
lookbehind: true
lookbehind: true,
greedy: true
},
'directive': {
pattern: /(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,
Expand All @@ -15,6 +16,7 @@
'string': {
pattern: /((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,
lookbehind: true,
greedy: true,
inside: {
'escape': {
pattern: /\\["'\\nrt]/,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-nginx.min.js

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

0 comments on commit 7b72e0a

Please sign in to comment.