Skip to content

Commit bee6ad5

Browse files
authoredDec 5, 2021
EditorConfig: Swap out property for key; alias with attr-name (#3272)
1 parent 220bc40 commit bee6ad5

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed
 

‎components/prism-editorconfig.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Prism.languages.editorconfig = {
2-
// https://editorconfig-specification.readthedocs.io/en/latest/
2+
// https://editorconfig-specification.readthedocs.io
33
'comment': /[;#].*/,
44
'section': {
55
pattern: /(^[ \t]*)\[.+\]/m,
@@ -11,13 +11,14 @@ Prism.languages.editorconfig = {
1111
'punctuation': /[\[\]{},]/
1212
}
1313
},
14-
'property': {
14+
'key': {
1515
pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,
16-
lookbehind: true
16+
lookbehind: true,
17+
alias: 'attr-name'
1718
},
1819
'value': {
1920
pattern: /=.*/,
20-
alias: 'string',
21+
alias: 'attr-value',
2122
inside: {
2223
'punctuation': /^=/
2324
}

‎components/prism-editorconfig.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/languages/editorconfig/key_value_feature.test

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ foobar = 42
55
----------------------------------------------------
66

77
[
8-
["property", "foo"],
8+
["key", "foo"],
99
["value", [
1010
["punctuation", "="],
1111
" Bar Baz"
1212
]],
13-
["property", "foobar"],
13+
["key", "foobar"],
1414
["value", [
1515
["punctuation", "="],
1616
" 42"
1717
]],
18-
["property", "another_value"],
18+
["key", "another_value"],
1919
["value", [
2020
["punctuation", "="],
2121
" with_indent"
@@ -24,4 +24,4 @@ foobar = 42
2424

2525
----------------------------------------------------
2626

27-
Checks for key/value pairs.
27+
Checks for key/value pairs.

0 commit comments

Comments
 (0)
Please sign in to comment.