|
b8ce1e7c
|
2016-12-03T11:52:48
|
|
Merge branch 'gh-pages' of https://github.com/PrismJS/prism into gh-pages
# Conflicts:
# components/prism-core.min.js
|
|
83bafbd4
|
2016-12-03T11:46:26
|
|
env.code can be modified by before-sanity-check hook even when using language-none. Fix #1066
|
|
17e33bc0
|
2016-11-20T12:52:54
|
|
Reduce risk of XSS (#1051)
* Skip non-own properties of env.attributes
Use `Object.keys` instead of a for-in loop to find optional attributes.
The former only grabs keys that are own properties, the latter also
includes inherit properties from `Object.prototype`.
This reduces the risk of XSS if an attacker somehow manages to
manipulate the prototype chain of the Object prototype.
* Fix root cause of XSS in autolinker plugin #1054
* command-line plugin: Safely encode attributes
If an attacker has control over the values of the attributes
"data-prompt", "data-user", or "data-host", then XSS was possible.
This fixes the issue, by encoding quotes as the `"` entity.
* show-language plugin: innerHTML -> textContent
There is no need for `innerHTML` here. At best nothing happens,
at worst XSS is possible (though the odds are negligible since
the attacker would have to control the detected language).
* toolbar plugin: innerHTML -> textContent
|
|
3cae6ce8
|
2016-11-19T12:16:31
|
|
Add support for Reason. Fix #1046
|
|
dfc19413
|
2016-11-09T01:57:46
|
|
Add support for the Jolie language (#1014)
* Added component for the Jolie language
* Added Jolie among the supported components
* update for merge
- revised jolie component
- added tests
- added code example
- minified with `gulp`
* fixes
* fixes
* fixed Jolie html file example and highlight for punctuation
* fixed indentation in test html file and added comma as punctuation
|
|
d75da8ee
|
2016-11-09T01:29:22
|
|
Fix order of decoding entities in groovy (#1049) (#1050)
|
|
8b0520a8
|
2016-11-09T01:27:40
|
|
Ruby: Make strings greedy. Fixes #1048
|
|
b42fa779
|
2016-11-09T01:26:50
|
|
Ini: Remove newline at end of minified file.
|
|
fe8ad8b8
|
2016-11-01T23:44:54
|
|
Remove important token in ini definition (#1047)
* rename prism-ini section token to selector
* updated min file
* use [ \t] instead of the more general \s
|
|
cba78f3e
|
2016-10-29T02:57:09
|
|
Add missing `from` keyword to typescript & set `ts` as alias. (#1042)
|
|
32cd99ff
|
2016-10-24T21:21:37
|
|
Fix greedy-flag bug
This bug occurs in the relatively rare case of a pattern matching the
empty string. It was reported in issue #1039. If for example a HTML
page contains an empty script tag `<script></script>` then the script
pattern will match anything inside, which is the empty string.
This empty string is then passed to the constructor of the Token class.
Since `""` is falsy in Javascript the property `matchedStr` is set to
`null`.
But the property `matchedStr` is needed to calculate the current
position for the greedy feature. A `null` value in `matchedStr` results
in a `pos` that is `NaN`. This causes the bug described in issue #1039.
Since the property `matchedStr` is only ever needed to calculate the
length of the Token, it is more efficient to store the length directly
instead of the string. As a side effect this also fixes issue #1039.
|
|
76ba1b83
|
2016-10-11T08:11:15
|
|
update patterns (#1032)
Updated NSIS
|
|
4cbdf4d2
|
2016-09-30T14:50:11
|
|
Reverse prism markup min
|
|
25a541d6
|
2016-09-28T21:16:33
|
|
JSON: Fixed issues with properties and strings + added tests. Fix #1025
|
|
ac21d337
|
2016-09-23T22:31:02
|
|
Update APL minified file + update test for iota underbar function
|
|
d9f8ae48
|
2016-09-23T22:28:03
|
|
Merge remote-tracking branch 'official/master' into gh-pages
|
|
3c5c89ac
|
2016-09-22T14:32:00
|
|
Add iota underbar (#1024)
It's used by NARS2000 now, and will be used by Dyalog APL in the future.
|
|
22cb0187
|
2016-09-14T05:44:22
|
|
Fix typo `Fload` to `Float` in prism-ruby.js (#1023)
|
|
1a86d34d
|
2016-09-02T00:36:34
|
|
Optimized block regexps to prevent struggling on large files. Fixes #1001
|
|
86aa3d21
|
2016-09-01T23:43:11
|
|
Revert #998 + run normalize-whitespace and remove-initial-line-feed plugins in the before-sanity-check hook. Fix #1018 (see issue for discussion)
|
|
f138f8f1
|
2016-09-01T23:40:14
|
|
Run gulp
|
|
e57e26d5
|
2016-08-17T15:56:41
|
|
Makes CSS strings greedy. Fix #1013
|
|
e9355cc4
|
2016-08-15T02:43:09
|
|
add prefix feature for custom class plugin
|
|
3dd72198
|
2016-08-05T03:32:09
|
|
Make doctype case insensetive (#1009)
|
|
d8fefde6
|
2016-07-12T09:09:52
|
|
Don't restore env.code from backupCode in Handlebars, PHP and Smarty components
|
|
c1a0c1bd
|
2016-07-11T20:37:47
|
|
Added TestCase.runTestsWithHooks + add missing tests. Updated documentation for test suite.
|
|
3dc8c9e1
|
2016-07-11T20:36:16
|
|
Don't insert space before ">" when there is no attributes
|
|
0224b7cc
|
2016-07-10T14:05:42
|
|
Merge pull request #994 from Golmote/prism-xojo
Add support for Xojo. Fix #898
|
|
8f5f1fa9
|
2016-07-07T09:13:47
|
|
SCSS: Highlight parent selector
|
|
13fed767
|
2016-07-07T09:09:51
|
|
CSS-extras: match attribute inside selectors
|
|
d6b5c2f0
|
2016-07-07T09:01:32
|
|
SCSS: Highlight variables inside selectors and properties.
|
|
fd09391e
|
2016-07-05T19:10:41
|
|
SCSS: Alias statement as keyword. Fix #246
|
|
318aab39
|
2016-07-05T19:00:52
|
|
Make PHP comments greedy. Fix #197
|
|
5e62f023
|
2016-07-04T20:13:26
|
|
Add support for Xojo. Fix #898
|
|
31ea66b6
|
2016-07-04T00:32:28
|
|
Allow for dots in Markup tag names, but not in HTML tags included in Textile. Fixes #888
|
|
65619f7e
|
2016-07-03T03:20:53
|
|
Add support for Ada (generic). Closes #949
|
|
c9bdcd35
|
2016-07-03T02:37:29
|
|
Manual merge of #988. Closes #988, fixes #987.
|
|
8de64b6b
|
2016-07-03T02:32:02
|
|
Run gulp
|
|
daef55f8
|
2016-07-01T02:23:23
|
|
JS: add exponentiation & spread/rest operator
Add JavaScript `**` and `...` operators
|
|
9c5ffb5e
|
2016-06-27T01:26:39
|
|
Merge remote-tracking branch 'official/gh-pages' into prism-livescript
Conflicts:
plugins/show-language/prism-show-language.js
plugins/show-language/prism-show-language.min.js
|
|
be6219a8
|
2016-06-27T01:21:50
|
|
Merge pull request #980 from Golmote/prism-properties
Add support for .properties files
|
|
4fda477e
|
2016-06-20T03:42:46
|
|
Merge pull request #977 from rbricheno/gh-pages
Fix highlighting of empty comments in PowerShell
|
|
9cfc8cb2
|
2016-06-18T19:39:36
|
|
Add support for LiveScript
|
|
2607dcd9
|
2016-06-18T14:46:44
|
|
Add support for .properties files
|
|
9893489c
|
2016-06-18T14:18:27
|
|
Replace flags property of RegExp with a more compatible alternative
|
|
912bdfe1
|
2016-06-18T08:16:48
|
|
Merge pull request #969 from atomantic/bash_npm
adding `npm` to common function list
|
|
e0180873
|
2016-06-16T08:15:59
|
|
Merge pull request #971 from Golmote/prism-graphql
Add support for GraphQL
|
|
a2633627
|
2016-06-16T08:14:11
|
|
Run gulp
|
|
b9a9de53
|
2016-06-15T16:17:08
|
|
Puppet highlighter: Fix over-greedy regexp detection
The `regex` token was allowing /regexps/ to start after the word `node` or after
any non-word character. This ends up being too greedy! For example, take this
common code, using variable interpolation in a string that represents a file
path:
file { "${master_config_dir}/.ssh":
ensure => file,
owner => 'jenkins',
group => 'jenkins',
mode => '0600',
}
The highlighter will start a regexp at `/.ssh`, in the middle of the string, and
continue for however many lines it takes to reach another slash.
So instead, let's be more conservative about where we might find a regexp. I
suggest:
- After `node`.
- After one of the following characters: `~=([{,`
- This catches usage in variable assignment, the `=~`/`!~` operators,
function calls, case statement and selector blocks, arrays, and data type
objects that accept parameters (`Pattern[/.../]`, etc.).
- After `=>` (and the lesser-used `+>`) for hashes and resource attributes.
- At the start of a line, for, e.g., the LHS of the `in` operator. (I'm not 100%
sure we should cover this case for a simple highlighter like Prism, and it's
the one I'd most expect to cause problems later, but... I think it's ok...)
This commit appears to fix the worst of the mid-string blowouts.
|
|
311a890e
|
2016-06-15T17:14:28
|
|
Fix highlighting of empty comments
A single # on a line by itself with no other characters following it is a valid comment in powershell.
|
|
0e3e938d
|
2016-06-15T17:13:07
|
|
Fix highlighting of empty comments
A single # on a line by itself with no other characters following it is a valid comment in powershell.
|
|
500121ba
|
2016-06-11T09:12:05
|
|
Merge pull request #967 from zeitgeist87/ImprovedGreedyFlag
Improvement to greedy-flag
|
|
bfb559bf
|
2016-06-11T01:17:24
|
|
Add support for GraphQL
|
|
babdf740
|
2016-06-08T22:29:12
|
|
adding `npm` to common function list
|
|
740e8900
|
2016-06-05T07:33:36
|
|
Update CHANGELOG and auto-generated files
|
|
d80900cc
|
2016-06-04T19:52:38
|
|
Improvement to greedy-flag
This patch expands the idea of the greedy flag and significantly
improves it, by matching against the whole text instead of just
the next couple of tokens. This does not only improve the
results, but it should also slightly improve performance.
|
|
1158e460
|
2016-06-03T11:34:01
|
|
Rearrange the `string` and `template-string` token in JavaScript
It is more likely that single and double quotes appear in
a template string, than backticks in a normal string. Fixes issue
#963.
|
|
0c4d8d7d
|
2016-06-03T09:18:06
|
|
Merge pull request #959 from rupl/75-async
Allow for asynchronous loading of prism.js
|
|
f130680c
|
2016-05-29T11:15:59
|
|
Use requestAnimationFrame instead of setTimeout
|
|
b6b40ec0
|
2016-05-29T00:46:11
|
|
Merge pull request #958 from kaplanoah/gh-pages
add delimeter and delimeters keywords to sql
|
|
4eb7ee45
|
2016-05-26T11:27:03
|
|
Allow for asynchronous loading of prism.js
|
|
a9ef24e3
|
2016-05-25T11:50:45
|
|
add delimeter keywords to sql
|
|
acd9508f
|
2016-05-17T14:23:02
|
|
Use toLowerCase on language names
|
|
caea2afe
|
2016-05-15T20:38:26
|
|
add auto_increment and date sql keywords
|
|
4d0526fa
|
2016-05-12T11:30:53
|
|
Highlight diff lines with only + or -
|
|
21dd0d14
|
2016-02-15T23:08:24
|
|
Use a HTML-comment to escape code
|
|
6f75735e
|
2016-04-30T15:43:07
|
|
Support for generic methods in csharp
|
|
964450e1
|
2016-04-30T13:35:01
|
|
Apply the new greedy flag to a few languages
This patch applies the new greedy flag to a few languages and
adds the corresponding test cases.
|
|
8477e457
|
2016-04-30T11:58:43
|
|
Minor fix for the YAML language
Recent changes to YAML caused it to fail some test cases. This
patch fixes this minor problem, by excluding whitespace
characters from the "key"-pattern.
|
|
71e57594
|
2016-04-30T11:52:51
|
|
Add basic test cases for the Bro language
This patch adds basic tests for the Bro language and it enables
the greedy-flag for the string token.
|
|
3eec2b75
|
2016-04-30T11:49:08
|
|
Add some simple test cases for the protobuf language
This patch adds basic test cases for the protobuf language and
fixes some whitespace issues. It also adds the missing
requirement to the clike language to components.js.
|
|
d25047d7
|
2016-04-29T14:50:46
|
|
Merge pull request #943 from larsks/bug/942
fix hilighting of YAML keys on first line of code block
|
|
f19db819
|
2016-04-29T12:05:00
|
|
fix hilighting of YAML keys on first line of code block
The YAML highlighter would fail to highlight a key if it occurred on
the first line of a `<code>` block, as in:
<pre><code>somekey: somevalue
anotherkey: anothervalue</pre></code>
This adds "beginning of file" as an acceptable marker for the start of
a key.
Resolves #942 and, it turns out, #649.
|
|
f081b905
|
2016-04-29T16:39:46
|
|
Rename proto language into protobuf and add it to components.js
|
|
ae4a4f2f
|
2016-04-25T17:57:06
|
|
add protobuf support
|
|
b8275198
|
2016-04-07T23:50:03
|
|
Fixed whitespaces, reordered tokens, used Gulp to min JS
|
|
ea507962
|
2016-04-07T01:20:30
|
|
Updated minified JS file
|
|
5bdb22e6
|
2016-04-07T01:18:46
|
|
Corrected indentation issue
|
|
22bf9c55
|
2016-04-07T01:12:38
|
|
Fixed issues pointed out in previous pull request
|
|
8a9f30fa
|
2016-04-01T02:48:10
|
|
Minified prism-bro.js file to prism-bro.min.js
|
|
9e8d4f99
|
2016-04-01T02:08:35
|
|
More improvements to Bro
|
|
b25a7515
|
2016-03-31T03:34:23
|
|
Added Bro support to Prism
|
|
1b905b9e
|
2016-03-31T11:24:29
|
|
Update PROC step/keyword regex to be more restrictive.
|
|
85ef5179
|
2016-03-30T10:25:36
|
|
Add missing keywords for SAS.
Two changes:
(1) PROC keyword now also includes its associated name (e.g., PROC TABULATE, PROC SQL).
(2) QUIT now included, as it is used to close/complete various procedures.
|
|
49cf8991
|
2016-03-08T15:03:59
|
|
Fix minor bug with new greedy-feature
This fixes a minor bug that causes invalid highlighting in some
edge cases, where two greedy patterns overlap each other.
|
|
367ace62
|
2016-03-05T17:41:56
|
|
1)Adding annotation token for Java
2)Aliasing java annotation to punctuation
3)Aliasing grovy annotation to punctuation
4)Adding in sample code
|
|
954c90a2
|
2016-02-20T21:01:45
|
|
Merge pull request #779 from zeitgeist87/gh-pages
Partial solution for the "Comment-like substrings"-problem
|
|
c88036ca
|
2016-02-19T22:27:22
|
|
Add tests for new greedy-pattern feature and fix bug in Kotlin
This patch adds tests for the new greedy-pattern feature and fixes
a small bug in the Kotlin language, that resulted from that.
It also cleans up some of the comments and refactors a few lines
in the tokenloop.
|
|
24a09361
|
2016-02-19T13:38:54
|
|
Fix double HTML-encoding bug in Groovy language
|
|
90432f96
|
2016-02-18T01:22:40
|
|
Add comments to better document the greedy-pattern feature
|
|
2705c509
|
2015-09-24T19:36:10
|
|
Partial solution for the "Comment-like substrings"-problem
This patch introduces a new attribute called `greedy`. The
attribute is a simple boolean flag. If there is no match
for a greedy pattern it can concatenate the next two tokens
into a single string and try to match on this string again.
If a match is found on the second attempt, then the old tokens are
deleted and replaced by the new match.
This solves the "Comment-like substrings"-problem for exactly one
comment at very little cost. With this patch the following code is
highlighted correctly:
"foo /* bar */ baz"; "foo // bar";
/lala"test"sdf/;
This approach fails if there are more than one comments inside the
string:
"foo /* bar */ baz /* bar */ baz";
Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
|
|
af8da8ec
|
2016-02-14T21:08:14
|
|
Implemented @zeitgeist87’s suggestion in #890 re: env.elements
|
|
70a8602f
|
2016-02-13T15:21:28
|
|
Add before-highlightall hook
Needed for unescaped markup plugin, as discussed in #887.
Alternatively, we could reinstate @zeitgeist87’s PR about making the selector a config option.
Thoughts?
|
|
ab65be27
|
2016-02-12T21:32:19
|
|
Fix catastrophic backtracking regex issues
|
|
b86c727a
|
2016-02-03T15:25:26
|
|
Fix DFS bug
The DFS function uses an object as a key into another object. This
doesn't work, because the key gets stringified to "[object
Object]" and is therefore useless.
|
|
0e87ff0a
|
2016-01-27T11:55:16
|
|
Add solarized light theme to the list of themes and update
auto-generated files generated by gulp.
|
|
7fab7a2d
|
2016-01-26T23:16:06
|
|
Reverse merge of last PR and remove the 'data-selector' attribute.
|
|
fa987435
|
2016-01-26T23:10:45
|
|
Use document.currentScript instead of
document.getElementsByTagName()
|
|
77c6ea17
|
2016-01-26T02:33:20
|
|
Allow users to use their own element selector
Add the parameter 'data-selector' to the script tag, to
allow users to set the selector used to query for code elements.
|
|
1eb9a5fb
|
2016-01-17T13:56:32
|
|
Update auto-generated files
|