Skip to content

Commit

Permalink
C-like: Change order of comment patterns and make multi-line one gree…
Browse files Browse the repository at this point in the history
…dy. Fix #1337
  • Loading branch information
Golmote committed Mar 7, 2018
1 parent b70feb8 commit b98e5b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions components/prism-clike.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Prism.languages.clike = {
'comment': [
{
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
},
{
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
lookbehind: true,
greedy: true
}
],
'string': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-clike.min.js

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

7 changes: 4 additions & 3 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,13 @@ if (Prism.languages.markup) {
Prism.languages.clike = {
'comment': [
{
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
},
{
pattern: /(^|[^\\:])\/\/.*/,
lookbehind: true
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
lookbehind: true,
greedy: true
}
],
'string': {
Expand Down

0 comments on commit b98e5b9

Please sign in to comment.