Skip to content

Commit

Permalink
EditorConfig: Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Jul 22, 2020
1 parent d7b14fa commit 3553175
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions components/prism-ignore.js
Expand Up @@ -2,26 +2,27 @@
Prism.languages.ignore = {
// https://git-scm.com/docs/gitignore
'header': {
pattern: /(^|[^\\])###.*/,
pattern: /^###.*/m,
lookbehind: true,
alias: ['comment', 'bold']
},
'section': {
pattern: /(^|[^\\])##.*/,
pattern: /^##.*/m,
lookbehind: true,
alias: 'comment'
},
'comment': {
pattern: /(^|[^\\])#.*/,
pattern: /^#.*/m,
lookbehind: true,
alias: 'namespace'
},
'entry': {
pattern: /\S(?:.*(?:(?:\\ )|\S))?/,
alias: 'string',
inside: {
'operator': /^!|\*\*?|\?/,
'regex': {
pattern: /^!|(^|[^\\])[\[\]]/,
pattern: /(^|[^\\])\[[^\[\]]*\]/,
lookbehind: true
},
'punctuation': /\//
Expand Down
2 changes: 1 addition & 1 deletion components/prism-ignore.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 tests/languages/ignore/comment_feature.test
Expand Up @@ -11,7 +11,7 @@
["section", "## Section comment"],
["header", "### Header comment"],
["entry", ["\\# Not a comment"]],
["entry", ["\\#"]], ["comment", "# Not a section"]
["entry", ["\\## Not a section"]]
]

----------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions tests/languages/ignore/entry_feature.test
Expand Up @@ -8,9 +8,9 @@ notes\[1\].txt

[
["entry", ["foo", ["punctuation", "/"], "bar", ["punctuation", "/"]]],
["entry", ["foo", ["punctuation", "/"], "file", ["regex", "["], "1-3", ["regex", "]"], ".txt"]],
["entry", [["regex", "!"], "unignore"]],
["entry", ["\\!foo", ["punctuation", "/"], "**"]],
["entry", ["foo", ["punctuation", "/"], "file", ["regex", "[1-3]"], ".txt"]],
["entry", [["operator", "!"], "unignore"]],
["entry", ["\\!foo", ["punctuation", "/"], ["operator", "**"]]],
["entry", ["notes\\[1\\].txt"]]
]

Expand Down

0 comments on commit 3553175

Please sign in to comment.