Skip to content

Commit b68efaf

Browse files
committed
solving whole block highlighting bug
1 parent e93595e commit b68efaf

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

src/languages/systemd.js

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function(hljs) {
1212
relevance: 0
1313
};
1414

15-
const STRINGS = {
15+
const STRING = {
1616
className: 'string',
1717
begin: /"/,
1818
end: /"/,
@@ -29,8 +29,7 @@ export default function(hljs) {
2929

3030
const SECTION = {
3131
className: 'section',
32-
begin: /^\[(Desktop Entry|Unit|Service|Install|Socket|Mount|Automount|Swap|Path|Timer|Slice|Scope|Manager|connection|ipv4|ipv6|802-3-ethernet|802-11-wireless|802-11-wireless-security|vpn|Journal|Bridge|Desktop Action\s+[A-Za-z0-9_-]+)\]/,
33-
end: /\]/,
32+
begin: /^\[(Desktop Entry|Unit|Service|Install|Socket|Mount|Automount|Swap|Path|Timer|Slice|Scope|Manager|connection|ipv4|ipv6|802-3-ethernet|802-11-wireless|802-11-wireless-security|vpn|Journal|Bridge|Desktop Action\s+[A-Za-z0-9_-]+)\]$/,
3433
relevance: 10
3534
};
3635

@@ -51,31 +50,19 @@ export default function(hljs) {
5150
relevance: 0
5251
},
5352
{
54-
begin: /\S.*/,
55-
end: /$/,
56-
excludeBegin: false,
57-
contains: [
58-
{
59-
className: 'literal',
60-
match: /\b(Application|Link|Directory|forking|oneshot|OneShot|true|false|True|False)\b/,
61-
relevance: 10
62-
},
63-
STRINGS,
64-
FIELD_CODES
65-
// 일반 값은 하이라이팅 없음
66-
],
67-
relevance: 0
68-
}
53+
className: 'literal',
54+
match: /\b(Application|Link|Directory|forking|oneshot|OneShot|true|false|True|False)\b/,
55+
relevance: 10
56+
},
57+
STRING,
58+
FIELD_CODES
6959
]
7060
};
7161

7262
return {
7363
name: 'Systemd (INI-like)',
74-
aliases: [ 'desktop', 'service', 'mount', 'socket', 'timer', 'nmconnection', 'systemd' ],
64+
aliases: ['desktop', 'service', 'mount', 'socket', 'timer', 'nmconnection', 'systemd'],
7565
case_insensitive: false,
76-
keywords: {
77-
literal: 'Application Link Directory forking oneshot OneShot true false True False'
78-
},
7966
contains: [
8067
COMMENT,
8168
SECTION,

0 commit comments

Comments
 (0)