Skip to content

Commit 77c4b64

Browse files
committed
recover left side syntax highlighting
1 parent 61097c9 commit 77c4b64

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

src/languages/systemd.js

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,10 @@ export default function(hljs) {
3434
relevance: 10
3535
};
3636

37-
const VALUE_CONTENT_MODE = {
38-
begin: /(?<==)/,
39-
end: /$/,
40-
contains: [
41-
QUOTED_STRING,
42-
FIELD_CODES,
43-
COMMENT_MODE
44-
],
45-
relevance: 0
46-
};
47-
4837
const KEY_VALUE_PAIR = {
49-
begin: /^([A-Za-z0-9_-]+(\[[A-Za-z0-9_@.]+\])?)\s*(=)/,
38+
begin: /^[A-Za-z0-9_-]+(\[[A-Za-z0-9_@.]+\])?\s*=/,
5039
end: /$/,
40+
returnBegin: true,
5141
contains: [
5242
{
5343
className: 'attribute',
@@ -62,32 +52,25 @@ export default function(hljs) {
6252
relevance: 0
6353
},
6454
{
65-
begin: /(?<=^Type\s*=)/,
55+
begin: /(?<==\s*)/,
6656
end: /$/,
6757
contains: [
6858
{
6959
className: 'literal',
70-
begin: LITERAL_WORDS_PATTERN,
60+
begin: /(^|;)\s*(Type\s*=)?\b(Application|Link|Directory)\b/,
7161
relevance: 10
7262
},
73-
COMMENT_MODE
74-
],
75-
relevance: 0
76-
},
77-
{
78-
begin: /(?<=^(Terminal|StartupNotify)\s*=)/,
79-
end: /$/,
80-
contains: [
8163
{
8264
className: 'literal',
83-
begin: /\b(true|false)\b/,
65+
begin: /(^|;)\s*(Terminal|StartupNotify)\s*=\s*\b(true|false)\b/,
8466
relevance: 10
8567
},
68+
QUOTED_STRING,
69+
FIELD_CODES,
8670
COMMENT_MODE
8771
],
8872
relevance: 0
89-
},
90-
VALUE_CONTENT_MODE
73+
}
9174
]
9275
};
9376

0 commit comments

Comments
 (0)