Skip to content

Commit baf6bb0

Browse files
RunDevelopmentmAAdhaTTah
authored andcommitted
Add support for # comments to INI language (#1730)
This PR resolved #1729. Disclaimer: # comments are only supported by [some implementation](https://en.wikipedia.org/wiki/INI_file).
1 parent 4362e42 commit baf6bb0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

components/prism-ini.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Prism.languages.ini= {
2-
'comment': /^[ \t]*;.*$/m,
2+
'comment': /^[ \t]*[;#].*$/m,
33
'selector': /^[ \t]*\[.*?\]/m,
44
'constant': /^[ \t]*[^\s=]+?(?=[ \t]*=)/m,
55
'attr-value': {
@@ -8,4 +8,4 @@ Prism.languages.ini= {
88
'punctuation': /^[=]/
99
}
1010
}
11-
};
11+
};

components/prism-ini.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
;
22
; foobar
3+
# foobar
34

45
----------------------------------------------------
56

67
[
78
["comment", ";"],
8-
["comment", "; foobar"]
9+
["comment", "; foobar"],
10+
["comment", "# foobar"]
911
]
1012

1113
----------------------------------------------------
1214

13-
Checks for comments.
15+
Checks for comments.

0 commit comments

Comments
 (0)