-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #980 from Golmote/prism-properties
Add support for .properties files
- Loading branch information
Showing
8 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Prism.languages.properties = { | ||
'comment': /^[ \t]*[#!].*$/m, | ||
'attr-value': { | ||
pattern: /(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?: *[=:] *| ))(?:\\(?:\r\n|[\s\S])|.)+/m, | ||
lookbehind: true | ||
}, | ||
'attr-name': /^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+?(?= *[ =:]| )/m, | ||
'punctuation': /[=:]/ | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<h1>.properties</h1> | ||
<p>To use this language, use the class "language-properties".</p> | ||
|
||
<h2>Comments</h2> | ||
<pre><code># This is a comment | ||
! This is a comment too</code></pre> | ||
|
||
<h2>Properties</h2> | ||
<pre><code>some_key some_value | ||
some\ key\ with\ spaces : some value | ||
some_key = some \ | ||
multiline value</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
! | ||
# Foobar baz | ||
! Foobar baz | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["comment", "#"], | ||
["comment", "!"], | ||
["comment", "# Foobar baz"], | ||
["comment", "! Foobar baz"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
foo bar | ||
foo\:\=\ bar bar\:\= \ | ||
baz | ||
foo = bar | ||
foo\:\=\ bar = bar\:\= \ | ||
baz | ||
foo : bar | ||
foo\:\=\ bar : bar\:\= \ | ||
baz | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["attr-name", "foo"], | ||
["attr-value", "bar"], | ||
["attr-name", "foo\\:\\=\\ bar"], | ||
["attr-value", "bar\\:\\= \\\r\nbaz"], | ||
|
||
["attr-name", "foo"], | ||
["punctuation", "="], | ||
["attr-value", "bar"], | ||
["attr-name", "foo\\:\\=\\ bar"], | ||
["punctuation", "="], | ||
["attr-value", "bar\\:\\= \\\r\nbaz"], | ||
|
||
["attr-name", "foo"], | ||
["punctuation", ":"], | ||
["attr-value", "bar"], | ||
["attr-name", "foo\\:\\=\\ bar"], | ||
["punctuation", ":"], | ||
["attr-value", "bar\\:\\= \\\r\nbaz"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for keys and values. |