|
312e989c
|
2014-08-19T12:01:00
|
|
Fix line-numbers for PHP in markup
The problem is, that inline php code can be anywhere inside of a HTML
element. To properly highlight this the php language implementation
temporarily replaces all inline php code in `env.code` with something
like `{{PHP0}}`. After the markup highlighting is finished it replaces
it again with the real code, but it leaves `env.code` corrupted.
Since the line-numbers plugin uses `env.code` to count the number of
lines, the result will be broken.
So to fix this, it must be ensured, that `env.code` is restored before
the line-numbers plugin uses it.
|
|
e29996a4
|
2014-08-18T04:03:33
|
|
Merge pull request #312 from aviaryan/c-autohotkey
updated autohotkey for #307
|
|
f88c71ab
|
2014-08-15T17:34:36
|
|
Merge pull request #281 from natecook1000/gh-pages
Comprehensive Swift syntax highlighting
|
|
3cd1cb38
|
2014-08-15T16:30:50
|
|
Update Swift syntax for beta 5
|
|
76808147
|
2014-08-15T11:22:54
|
|
fix conflict in prism-swift.min.js
|
|
5acdc618
|
2014-08-15T11:22:29
|
|
Merge remote-tracking branch 'upstream/gh-pages' into gh-pages
|
|
1bd193f7
|
2014-08-15T02:52:54
|
|
Merge pull request #330 from apfelbox/test-dependency-loader
Added recursive dependency loader for test page
|
|
011e430c
|
2014-08-13T16:49:24
|
|
Added missing comma in components.json
|
|
e1a659d3
|
2014-08-13T16:46:45
|
|
Merge pull request #295 from bholst/gh-pages
Add language definition for Haskell
|
|
cf763e09
|
2014-08-13T16:36:50
|
|
Added recursive dependency loader for test page
* The page can now load dependencies of the required language recursively
* It first loads the dependencies, then the main language
* It is implemented using promises
The [promises polyfill from jakearchibald](https://github.com/jakearchibald/es6-promise) is used - the polyfill should fallback to browser behaviour, if native promises are supported.
|
|
74578aa0
|
2014-08-13T09:17:49
|
|
Update minified haskell definitions
|
|
6e26a58b
|
2014-08-12T21:35:01
|
|
Correct haskell support for strings and characters
This commit adds correct support for Haskell characters and strings.
To me, having only one type of token for characters and strings makes
no sense in Haskell as they can be distinguished easily.
Characters start with a single quote and strings start with a double
quote. Furthermore, characters can only contain —guess what— one
character whereas strings can caintain multiple or none of them.
String can also have gaps.
|
|
a70fadfd
|
2014-08-12T20:50:42
|
|
Add support for other numbers
Add support for
* hexadecimal numbers
* octal numbers
* floating point numbers with exponent
|
|
8cc777d9
|
2014-08-12T18:26:03
|
|
Make coding style in the themes more consistent
* Use tabs
* Use the same indention & whitespaces rules everywhere
|
|
297a150e
|
2014-08-12T18:08:42
|
|
Merge pull request #279 from apfelbox/line-height
Define default line height in all themes
|
|
ce354254
|
2014-06-20T13:54:37
|
|
Define default line height in all themes
This should fix #40 & #278
|
|
e1c2148c
|
2014-08-12T16:28:42
|
|
Remove remaining entities
|
|
d60c1bd5
|
2014-08-12T06:24:52
|
|
Merge pull request #327 from zeitgeist87/UseArraySyntax
Use the new array syntax for clike and coffeescript
|
|
e348e602
|
2014-08-12T12:11:31
|
|
Add auto generated files
|
|
1724e7a1
|
2014-08-11T08:26:48
|
|
Use the new array syntax for clike and coffeescript
This patch uses the new array syntax for the `clike` language and for
`coffeescript`. For `clike` it fixes a minor bug, whereby The character
immediately in front of a single line comment is
highlighted as a comment as well.
something// something
This is because both definitions for single and multiline comments
have to be matched with a single regex and the `lookbehind` parameter
can only be applied to the first captured string.
For `coffeescript` the previously used `block-comment` token name is no
longer necessary.
|
|
74e3dcbd
|
2014-08-12T05:30:31
|
|
Merge pull request #321 from zeitgeist87/gh-pages
Allow multiple regex per token name by using arrays
|
|
89bddb84
|
2014-08-12T11:27:26
|
|
Add automatically generated files
|
|
43e4e693
|
2014-08-10T23:26:10
|
|
Allow multiple regex per token name by using arrays
In most languages there are multiple different ways of declaring the
same constructs (e.g. comments, strings, ...) and sometimes it is
difficult or unpractical to match all of them with one single regular
expression. This patch adds the possibility to use an array of pattern
objects.
For example there is a minor bug in the current definition of the
`clike` language, that could be solved with this patch:
The character immediately in front of a single line comment is
highlighted as a comment as well.
something// something
This is because both definitions for single and multiline comments
have to be matched with a single regex and the `lookbehind` parameter
can only be applied to the first captured string.
With this patch one could split the two definitions up and use
`lookbehind` for both, thereby eliminating the bug.
'comment': [
{
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//g,
lookbehind: true
},
{
pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/g,
lookbehind: true
}
],
|
|
73cf4cc0
|
2014-08-12T01:19:14
|
|
Merge pull request #325 from zeitgeist87/FixJava
Fix Java operators to correctly highlight examples.html
|
|
4d352495
|
2014-08-12T01:16:07
|
|
Fix Java operators to correctly highlight examples.html
This patch basically adds a lot of `=?` at the end of operators that
were missing. The order of the `>=` and `<=` operator was wrong. It also
changes the order of the lookbehind pattern, so that the start of the
line is matched first. This last change fixes a lot of the bugs on the
`example.html` page.
The design of Prism makes it seem as if the regex multi line flag has no
effect, because strings are continuosly split up before the regexes are
applied. In this case it is necessary so that `^` is interpreted as the
start of a line instead of the start of the document.
|
|
45596956
|
2014-08-12T00:27:23
|
|
Merge pull request #322 from zeitgeist87/ExampleFix2
Add HTTP, Coffeescript and Java to gulpfile
|
|
48535016
|
2014-08-11T07:59:09
|
|
Add HTTP, Coffeescript and Java to example.html
If those languages are not included `examples.html` has a lot
of code, that is not highlighted at all.
|
|
fd69b247
|
2014-08-10T16:06:38
|
|
Merge pull request #319 from zeitgeist87/gh-pages
Allow multiple tokens to be mapped to the same CSS class
|
|
fef8cd49
|
2014-08-10T08:24:02
|
|
Allow multiple tokens to be mapped to the same CSS class
In most languages there are different ways of declaring the same
constructs, but with the current implementation of Prism it is only
possible to define one pattern for a particular token type. This is not
a problem, as long as it is possible to match everything with one regex.
But sometimes it isn't easily possible to do that, especially if things
like `lookbehind` or `inside` are needed for one part but not for the
other. This patch splits the token type into two parts, whereby the
second part is optional: {token type}#{description}
For example there is a minor bug in the current definition of the
`clike` language, that could be solved with this patch:
The character immediately in front of a single line comment is
highlighted as a comment as well.
something// something
This is because both definitions for single and multiline comments have
to be matched with a single regex and the `lookbehind` parameter can
only be applied to the first captured string.
With this patch one could split the two definitions up and use
`lookbehind` for both, thereby eliminating the bug.
'comment': {
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//g,
lookbehind: true
},
'comment#single-line': {
pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/g,
lookbehind: true
},
|
|
d4824538
|
2014-08-08T19:12:12
|
|
Added minified latex language definition
|
|
5f661409
|
2014-08-08T12:34:15
|
|
Merge pull request #316 from japborst/gh-pages
Added initial LaTeX support
|
|
24bf8ab7
|
2014-08-08T13:16:06
|
|
Included LaTeX suggestions
|
|
657b089f
|
2014-08-06T19:44:18
|
|
Added initial LaTeX support
|
|
e76c4b90
|
2014-08-01T22:04:58
|
|
optimized autohotkey.js even more
|
|
2ad320bd
|
2014-08-01T14:10:06
|
|
optimized the regex a bit
|
|
76e66b91
|
2014-08-01T10:09:21
|
|
updated autohotkey for #307, fixes it
|
|
8694191f
|
2014-07-31T14:30:41
|
|
Merge pull request #311 from apfelbox/fix-external-link
Fix link to Kevin Lorenz' Website + removed whitespace
|
|
b6f21e0e
|
2014-07-31T14:29:51
|
|
Fix link to Kevin Lorenz' Website + removed whitespace
|
|
c101a3fa
|
2014-07-29T10:53:54
|
|
Added default gulp task
It just builds components, plugins and the main prism.js file.
|
|
9cb8165f
|
2014-07-29T10:24:55
|
|
Merge pull request #269 from ben-eb/build-proc
Introduce a build process using gulp.js
|
|
b976afa4
|
2014-07-28T17:04:24
|
|
Bump dev dependencies.
|
|
4247baec
|
2014-07-28T16:54:50
|
|
Fix conflicts.
|
|
23abeedb
|
2014-07-24T16:57:31
|
|
Merge pull request #305 from brandonkelly/gh-pages
Added Twig language
|
|
ec93e86c
|
2014-07-24T12:51:18
|
|
Added Twig language
|
|
be225a04
|
2014-07-23T12:40:19
|
|
Merge pull request #304 from apfelbox/worker-fix
Fix workers & download page
|
|
502ed6c1
|
2014-07-23T10:49:30
|
|
Don't set the `self` variable with `var`
Firefox directly shadows the global variable `self` if it is present (= in a worker). So we need to set `self` without `var self` but directly.
|
|
eb1cd1c9
|
2014-07-23T09:49:34
|
|
Fix workers
The issue is that in workers `window` is undefined.
Therefore, in the first line, `self` will be set to `{}`.
This will destroy the check for workers later on:
```js
if (!self.document) {
if (!self.addEventListener) {
// in Node.js
return self.Prism;
}
// In worker
// ...
}
```
because `self.addEventListener` will then be undefined (due to `self = {}`).
The fix is to make the check for the environment more clever:
1. check for the browser: `(typeof window !== 'undefined')`
2. check for a worker: `(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)` (from http://stackoverflow.com/questions/7931182/reliably-detect-if-the-script-is-executing-in-a-web-worker)
3. assume we are in node
|
|
f1ceb831
|
2014-07-22T13:21:23
|
|
Merge pull request #303 from apfelbox/coy-improvements
Small improvement on the horizontal scroll bar of the coy theme
|
|
2e0b8ce4
|
2014-07-22T18:49:19
|
|
Coy theme: Fix issue with defined height of the <pre> tag
* The max-height on the `<pre>` is if there is no defined height.
The definitions of the code ensure, that the contents stay inside the `<pre>`. The `width: 100%` is need if there is no defined height of the `<pre>`, see http://stackoverflow.com/questions/14262938/child-with-max-height-100-overflows-parent.
|
|
fa2dedc2
|
2014-07-22T18:26:32
|
|
Fix small scrollbar issue in the coy theme
|
|
8ab37b09
|
2014-07-22T12:19:03
|
|
Merge pull request #301 from apfelbox/coy-line-numbers
Fix hidden line numbers in coy theme
|
|
84d21b19
|
2014-07-22T17:24:28
|
|
Further improvements of the coy themes
* Shadows are now visible again!
* Small code cleanup (removed now unnecessary outer `max-height`)
|
|
b42f3b0b
|
2014-07-22T15:25:27
|
|
Fix hidden line numbers
The issue is that the `<code>` element needs the `overflow: scroll` (since the code block has a `max-height`). So the line numbers container, which is positioned absolutely using a negative left position is hidden.
This is fixed by changing the way the `<code>` element is positioned: not with a margin and a small size, but with the padding & a larger container.
|
|
0fec5532
|
2014-07-20T09:32:36
|
|
Merge pull request #297 from uranusjr/objc-291
Update Objective-C rules based on #291
|
|
c960493e
|
2014-07-20T11:25:41
|
|
Update Objective-C rules based on #291
|
|
ce35c97b
|
2014-07-13T22:45:29
|
|
Fix documentation Haskell language definitions
|
|
62fc8621
|
2014-07-13T22:34:03
|
|
Fix handling of '.' in Haskell definition
The character '.' may be either a part of an operator, an operator by
itself or a separator between module name and variable.
|
|
e7a1c5d3
|
2014-07-13T21:56:40
|
|
Remove escaped entities from Haskell language def
|
|
8a77383b
|
2014-07-13T20:49:37
|
|
Add language definition for Haskell
|
|
970338c2
|
2014-07-13T11:31:53
|
|
Merge pull request #294 from aviaryan/c-ini
ini now also highlights value
|
|
8beaa6fb
|
2014-07-13T13:26:00
|
|
fixed another bug with ini highlight
|
|
70677495
|
2014-07-13T12:51:06
|
|
ini now also highlights value
|
|
73855ea2
|
2014-07-12T12:41:40
|
|
Merge pull request #292 from aviaryan/c-autohotkey
updated autohotkey minified file
|
|
513a53af
|
2014-07-12T13:08:37
|
|
updated autohotkey minified file
|
|
5b4b9682
|
2014-07-11T16:51:51
|
|
Merge pull request #291 from zeitgeist87/gh-pages
Fix for some serious bugs in C and C++ highlighter
|
|
550c81e7
|
2014-07-11T21:21:27
|
|
Fix for some serious bugs in C and C++ highlighter
< and > don't seem to work as they used to. So this patch replaces
them with the corresponding < or > sign like it was done in the clike
base language.
The pattern for macro statements was seriously flawed. It didn't allow
for macros with no argument like #else or #endif. This patch fixes the
problem and additionally adds support for multiline macros, which are
fairly common.
#define FOO(a, b, c) \
do { \
do_stuff_here \
do_more_stuff \
} while (0)
Furthermore the path of the #include macro is highlighted as a string.
#include <stdio.h>
#include "config.h"
C also allows for multiline strings in a similar way as multiline
macros.
"This is a \
multiline \
string"
|
|
a1047294
|
2014-07-11T12:40:46
|
|
Merge pull request #290 from aviaryan/c-autohotkey
updated autohotkey.js
|
|
5b3f31da
|
2014-07-11T12:30:40
|
|
Merge pull request #289 from aviaryan/c-ini
fixed some bugs in INI highlighting
|
|
41396d8d
|
2014-07-11T18:23:48
|
|
fixed some keywords
|
|
058f8e9d
|
2014-07-11T17:59:45
|
|
rearranged some keywords
|
|
a8c9775b
|
2014-07-11T15:55:23
|
|
enhanced autohotkey js
|
|
d5dd3be2
|
2014-07-11T12:00:49
|
|
updated ini minified file
|
|
d4f03482
|
2014-07-11T11:47:07
|
|
fixed bugs with ini highlight
|
|
af7a42a4
|
2014-07-10T19:25:02
|
|
Updated minified versions
|
|
51531e06
|
2014-07-10T10:24:42
|
|
Merge pull request #288 from aviaryan/gh-pages
Added AutoHotkey and Ini highlighting, resolved #287
|
|
bb997900
|
2014-07-10T17:15:14
|
|
alphabetically arranged keywords
|
|
d648f371
|
2014-07-10T13:51:29
|
|
added Ini highlighting
|
|
a156e893
|
2014-07-09T15:08:02
|
|
added separate highlighting token for 'function' in prism.css, closes #287
|
|
37c2c180
|
2014-07-09T15:04:15
|
|
added AutoHotkey highlighting
|
|
cbe9b042
|
2014-07-03T16:13:36
|
|
Merge pull request #285 from TheCrambler/gh-pages
Added Prism.js Tutorial Link
|
|
a530a1b7
|
2014-07-03T13:32:44
|
|
Added Prism.js Tutorail Link
Added an extra link to a tutorial I wrote on how to implement Prism.js into a WordPress site.
|
|
2182709d
|
2014-06-30T08:46:36
|
|
Merge pull request #284 from MathieuAlphamosa/patch-1
SQL : Multi lines strings
|
|
069fa6d8
|
2014-06-30T11:17:22
|
|
Update prism-sql.js
Faster and more reliable http://jsperf.com/javascript-multiline-regexp-workarounds
|
|
42ab9b44
|
2014-06-27T11:11:22
|
|
SQL : Multi lines strings
'string' regex modified to accept line breaks as SQL strings can use them.
|
|
4c2eddc3
|
2014-06-25T16:13:26
|
|
Merge pull request #282 from uranusjr/objc
Add Objective-C Syntax
|
|
e6ff300c
|
2014-06-26T04:04:42
|
|
Use tabs for indentation
|
|
62687ecc
|
2014-06-26T03:59:26
|
|
objc -> objectivec
|
|
ecb20c18
|
2014-06-25T22:06:06
|
|
Add objc to components
|
|
c76f777d
|
2014-06-25T21:35:03
|
|
Add Objective-C syntax
|
|
ce28de1e
|
2014-06-24T22:27:17
|
|
Comprehensive Swift syntax highlighting
|
|
a13db04a
|
2014-06-17T08:55:00
|
|
Merge pull request #277 from apfelbox/gh-pages
Made components.js re-usable
|
|
527c0f98
|
2014-06-17T14:25:27
|
|
components.js update
* made `components.js` use a JSON-compatible structure
* remove the exclusion through bower
|
|
55724eb9
|
2014-06-04T19:22:45
|
|
Merge pull request #272 from ChrisChares/gh-pages
Added Swift Language
|
|
e2c11520
|
2014-06-04T17:18:43
|
|
added newline to end of prism-swift.js
|
|
efc1d2bc
|
2014-06-04T17:13:37
|
|
added swift language
|
|
84522d86
|
2014-06-03T07:23:01
|
|
Merge pull request #265 from rip-lang/rip
Grammar for new language, Rip
|
|
9d5a0969
|
2014-05-12T11:35:31
|
|
Recognize punctuation and reference
|
|
5d1cf199
|
2014-05-10T20:16:58
|
|
Recognize character
|
|
ee4b3838
|
2014-05-10T19:53:21
|
|
Recognize keywords
|
|
568728d9
|
2014-05-10T19:35:07
|
|
Recognize regex, symbol, string (crudely)
|