Skip to content

Commit

Permalink
Add support for # comments to INI language (#1730)
Browse files Browse the repository at this point in the history
This PR resolved #1729.

Disclaimer: # comments are only supported by [some implementation](https://en.wikipedia.org/wiki/INI_file).
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Feb 13, 2019
1 parent 4362e42 commit baf6bb0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/prism-ini.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Prism.languages.ini= {
'comment': /^[ \t]*;.*$/m,
'comment': /^[ \t]*[;#].*$/m,
'selector': /^[ \t]*\[.*?\]/m,
'constant': /^[ \t]*[^\s=]+?(?=[ \t]*=)/m,
'attr-value': {
Expand All @@ -8,4 +8,4 @@ Prism.languages.ini= {
'punctuation': /^[=]/
}
}
};
};
2 changes: 1 addition & 1 deletion components/prism-ini.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions tests/languages/ini/comment_feature.test
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
;
; foobar
# foobar

----------------------------------------------------

[
["comment", ";"],
["comment", "; foobar"]
["comment", "; foobar"],
["comment", "# foobar"]
]

----------------------------------------------------

Checks for comments.
Checks for comments.

0 comments on commit baf6bb0

Please sign in to comment.