components


Log

Author Commit Date CI Message
Michael Schmidt a91be7b2 2019-03-22T18:16:03 Apache config: Minor improvements + new keyword (#1823) This adds the `SSLSessionTickets` word to the list of inline directives and compresses current word lists.
Michal 30779976 2019-03-20T22:10:17 Added support for CMake language (#1820) This adds support for the [CMake](https://cmake.org/) language.
Michael Schmidt f2d8e1c7 2019-03-14T15:03:11 JS: Keyword fix (#1808) This fixes false positives with properties which have the same name as keywords.
Michael Schmidt 11d0f75e 2019-03-14T13:17:45 Applied Array.isArray (#1804) This replaces all occurrences of `Prism.util.type(variable) {!==, ===} 'Array'` with an equivalent `Array.isArray` expression.
Michael Schmidt bc53e093 2019-03-11T00:20:18 More variables for better code compression (#1489) This introduces more variables for better code compression in a few languages.
Michael Schmidt 70a40414 2019-03-10T22:15:10 CSS extras: Highlighting for pseudo class arguments (#1650) This adds highlighting for pseudo class arguments, selector punctuation, and n-th expressions.
Michael Schmidt f2467488 2019-03-10T18:53:08 Django/Jinja2 improvements (#1800) This completely rewrites the Django language definition. It's now based on markup-templating.
Michael Schmidt af67c32e 2019-03-10T18:44:30 Markup `addInline` improvements (#1798) This makes some minor improvements to the new `addInline` function of markup.
Michael Schmidt b2298b12 2019-03-10T15:45:40 Added GraphQL improvements and tests (#1788) This makes some improvements to GraphQL and expands the existing tests.
Michael Schmidt 3e00bb9c 2019-03-07T15:22:30 Rebuilt Prism (#1794) This is a rebuilt of Prism to update minified files.
Michael Schmidt 8ca3d65b 2019-03-06T13:53:33 Markdown: The 'md' alias is now recognized by hooks (#1771) The hooks markdown adds itself will now recognize the `md` alias.
Michael Schmidt 86dd3e42 2019-03-06T13:49:05 Fixed patterns which can match the empty string (#1775) This changes patterns which match the empty string to always match at least one character.
Michael Schmidt a2d445d0 2019-03-06T13:22:08 CSS: Selectors can contain any string (#1638) This fixes that certain attribute value strings break the selector pattern.
Michael Schmidt c37c90df 2019-03-05T22:17:36 Added EJS (#1769) This adds the EJS (Embedded JavaScript templates) language to Prism.
Michael Schmidt c9a32674 2019-03-05T22:06:33 Fixed dependencies of Pug and Pure (#1759) This removes dependencies of Pug and Pure to languages which do not exist (yet).
Michael Schmidt c805f859 2019-03-05T16:56:13 Ruby/ERB: Fixed block comments (#1768) This fixes block comments in Ruby and ERB.
Michael Schmidt 571704cb 2019-03-04T23:38:57 Regex language (#1682) This adds a Regex language that adds itself to a few languages which have regex literals.
Michael Schmidt 57127701 2019-03-04T23:12:46 Markup: Added support for CSS and JS inside of CDATAs (#1660) This adds support for CSS/JS inside of (any number of) CDATAs.
Michael Schmidt 16f2ad06 2019-03-04T22:59:24 Added T4 Text Templates (#1699) This adds T4 Text Templates in both the C# and VB language variants.
Michael Schmidt 245b59d4 2019-03-04T22:17:23 CSS: Highlight attribute selector (#1671) This adds highlighting for CSS attributes selectors in CSS Extras
Jakub T. Jankiewicz f8c8add2 2019-03-03T14:10:47 Fixed operator-like functions in Scheme (#1467) This fixes operator-like functions in Scheme.
Michael Schmidt b62e282b 2019-03-03T00:01:55 Markup-templating improvements (#1653) This makes minor improvements to markup-templating.
Michael Schmidt bac09f0a 2019-03-02T17:27:19 Made prism-core a little more editor friendly (#1776) This makes the structure of prism-core easier to understand for editors.
wippysnib 3b396ef5 2019-03-02T04:09:06 Added new SAS keywords (#1784) This adds the SAS keywords libname, set, output, and options to the language definition.
ExE Boss b06f532f 2019-03-01T01:19:29 Core: Avoid redeclaring variables in util.clone (#1778) This changes util.clone to be more readable and to avoid redeclaring the `clone` and `id` variables.
Michael Schmidt 289ddd9b 2019-02-28T21:56:01 PHP: Fixed closing tag issue (#1652) This fixes that PHP's closing tag (`?>`) was detected inside strings and comments.
Michael Schmidt 152a68ef 2019-02-28T21:36:57 Improved languages.DFS and util.clone (#1506) Minor improvements for the two functions.
Michael Schmidt 493d19ef 2019-02-28T21:01:31 Added doc comment highlighting (#1541) This adds support for JavaDoc, JSDoc, TSDoc, and PHPDoc.
Michael Schmidt bb628606 2019-02-28T20:19:45 Added JS Extras (#1743) This adds JS Extras, a few additional features for the JS language.
Michael Schmidt 3560c643 2019-02-28T20:12:11 JS: Fixed variables named "async" (#1738) Fixes variables names "async" in JS.
Michael Schmidt c3862a24 2019-02-28T19:55:24 Fix for markup attributes (#1752) This fixes some issues related to markup (XML/HTML) attributes. See the PR for more detail.
Michael Schmidt 5fd7577a 2019-02-28T19:52:06 Smalltalk: Allowed empty strings and comments (#1747) This fixes that empty strings and comments were not recognized in Smalltalk.
Michael Schmidt 7bcec584 2019-02-28T19:41:00 Improved JS constant pattern (#1737) This changes the JS constant pattern so that all WebGL constants (like `FLOAT_MAT2x4`) are matched.
Michael Schmidt 8378ac83 2019-02-28T19:33:50 Improved JS function pattern (#1736) Allows for spaces around the punctuations of function invocation via `apply`, `bind`, or `call`.
Michael Schmidt 64dc049d 2019-02-28T19:28:22 Added JSON5 language (#1744) This adds the JSON5 language to Prism.
Michael Schmidt 13e1c97d 2019-02-28T19:23:25 Added EBNF language (#1756) This adds the EBNF language.
Michael Schmidt 1df96c55 2019-02-28T19:18:05 Added BNF and RBNF languages (#1754) This adds the BNF and RBNF languages.
Michael Schmidt 6d98f0e7 2019-02-28T19:10:37 Added ANBF language (#1753) This adds a new language: ANBF (Augmented Backus–Naur form).
Michael Schmidt b5041cf9 2019-02-26T05:41:01 Fix JSONP support (#1745) This PR fixes that JSON did not support [JSONP](https://en.wikipedia.org/wiki/JSONP) callback functions. I also added a JSON example page.
Michael Schmidt 5bd182c0 2019-02-26T04:43:27 Fix Lisp exponential string pattern (#1763) This PR fixes #1762 by fixing the `string` pattern which sometimes fails in exponential time.
Michael Schmidt bfbea4d6 2019-02-15T16:51:54 Fix `function-variable` in JS (#1739)
Michael Schmidt d9fa29a8 2019-02-15T16:03:59 Make `undefined` a keyword in JS (#1740)
Michael Schmidt bd0378f0 2019-02-14T13:23:49 Add `keyword` alias for SCSS' `null` (#1735) Add the `keyword` alias to the `null` pattern for SCSS. This was the last `null` pattern without any aliases (#1727).
ExE Boss fccfb98d 2019-02-14T01:25:25 Added `pnpm` function to Bash (#1734) This adds `pnpm` to the list of supported functions in Bash.
ExE Boss eee06649 2019-02-14T01:18:46 Added `keyword` alias to JSON's `null` (#1733) This adds the `keyword` alias to the `null` pattern in JSON.
Frankie Wittevrongel 3a32cb75 2019-02-13T22:33:38 Added `yarn add` to bash functions (#1731) Adds `yarn add` to bash functions.
Michael Schmidt baf6bb0c 2019-02-13T20:31:50 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).
Rex Zeng 4362e42c 2019-02-12T23:30:14 Support JSX/TSX class-name with dot (#1725) Adds class-name highlighting for JSX/TSX tag names containing dots.
Rex Zeng 57a92035 2019-02-12T20:43:31 Improved JavaScript parameter recognization (#1722) - The first letter of a parameter can now be upper case. - Fixes too greedy regex by introducing recursive expressions.
Michael Schmidt bc49c361 2019-01-24T12:51:18 Removed useless `insertBefore` call in Smarty (#1677) Removes a call to `insertBefore` which has no effect in Smarty.
Michael Schmidt e894fc89 2019-01-23T03:05:58 Inline regex source with gulp (#1537) Let gulp inline the source of inline regular expressions without flags in minified files. This means that gulp will replace `/regex/.source` with `'regex'`. ## Motivation Most IDEs support syntax highlighting and checking of JS inline regular expressions. This makes them easier to work with and less error-prone than having a string hold the expression. Inline regexes are also usually shorter than their string counterparts because you don't have to escape backslashes. There are also some linters (e.g. ESLint) for JS regular expression which (of course) won't work on strings. This lets you enjoy the advantages of inline regexes without worrying about the additional overhead of compiling another regular expression on the client side.
Michael Schmidt 0030a4ef 2019-01-23T03:03:04 Decouple XML from Markup (#1603) Decouple the XML language from the Markup language so that changes to `markup` do not affect `xml`. The `style` and `script` tags added by CSS and JS modify `markup` but not `xml`. Resolves #1597. --- We can't test this because the XML language is not in its own file.
Michael Schmidt 393ab164 2019-01-22T13:36:32 Call `insert-before` hook properly (#1709) Fixes #1706 (also includes a demo). The problem was that the `insert-before` hook was not called if `grammar` is undefined. This also fixes that `callback` was not called in that case and that `env` of the `complete` hook did not have a `highlightedCode` property. All other hooks are unchanged. The `insert-before` hook is only used by the Command line plugin, so there should be no other side effects.
Michael Schmidt 4c66d72c 2019-01-22T11:55:33 Show Language plugin alias support and improvements (#1683) Adds support for aliases and optimizes the name guessing.
Michael Schmidt fbf0b094 2019-01-22T02:20:17 Remove the Prism.tokenize language parameter (#1654) The `language` parameter of `tokenize` was unused and the only one calling `tokenize` with a value for the said parameter is Markup-templating (removed in #1653). It's not [documented](https://prismjs.com/extending.html#api) either.
Michael Schmidt 7eccea5c 2019-01-22T00:49:40 Improve C language (#1697) This PR adds support for [hexadecimal floating-point literals](http://www.cplusplus.com/doc/tutorial/structures/), and [`enum`](https://www.geeksforgeeks.org/enumeration-enum-c/) and [`struct`](https://www.tutorialspoint.com/cprogramming/c_structures.htm) class names.
Michael Schmidt 66f05ab0 2019-01-17T18:42:22 Deleted prism-hdl.min.js (#1712) This removes the extra prism-hdl.min.js.
Kuldar Kalvik 44aeffb9 2019-01-17T17:52:02 Improved field highlighting for GraphQL (#1711) Adds highlighting for GraphQL fields with arguments.
Stephan Max b94b56c1 2019-01-15T15:54:35 Added the Nand2Tetris HDL language (#1710) This adds support for the [Nand2Tetris](https://www.nand2tetris.org/) HDL language.
volado 439e3bd7 2019-01-11T00:54:01 Made false, true, and null constants in PHP (#1694) - This adds the `constant` alias to `false` and `true`. - `null` is no longer `keyword` but a `constant`.
Toby Wilds 7def8f5c 2019-01-03T23:52:27 Added N1QL language support (#1620) Adds support for[N1QL](https://www.couchbase.com/products/n1ql) for Couchbase.
volado 55fb0f8e 2019-01-03T17:22:02 Update PHP keywords (#1690) This removes PHP 4 specific keywords and adds new PHP keywords. Keywords previously classified as functions are now classified as keywords.
volado f1026b4b 2019-01-03T01:41:36 Improve recognition of constants in PHP (#1688) The pattern for PHP constants now have to be a valid identifier and recognizes single-letter names.
Thomas Parisot 88434f7a 2019-01-01T15:52:38 Added `adoc` alias for AsciiDoc (#1685) This adds the `adoc` alias for the AsciiDoc language.
JeongHoon Byun (aka Outsider) c939df8e 2018-12-27T20:56:24 Added support for HCL (#1594) Adds support for HCL ([HashiCorp configuration language](https://github.com/hashicorp/hcl)).
Valtteri Laitinen 4f6f3c7d 2018-12-24T17:28:06 Allow multiline CSS at-rules (#1676) Allows for CSS at-rules containing line breaks.
Volk b48c012c 2018-12-15T20:32:22 Added Vala language (#1658) Adds support for the Vala language.
anton-balaniuc 6e250a5f 2018-12-06T07:27:46 Added module keywords to Java. (#1655) This adds the in Java 9 introduced module keywords to Java. Namespaces following these keywords are also properly highlighted.
Gal Schlezinger 8b1bb469 2018-12-03T15:34:30 Added additional operators to Reason (#1648) This adds the `|>` and `->` operators to Reason.
Michael Schmidt 9de47d3a 2018-12-03T14:20:07 Fixed CSS extra variable (#1649) Details are described [here](https://github.com/PrismJS/prism/pull/1450#discussion_r238257002). I decided to go with the property variant, highlighting custom property declarations as `variable`.
Rex Zeng 5fcee966 2018-12-03T20:55:22 Identify CSS units and variables (#1450) Assume CSS unit is a word or `%` after a number, CSS variable is a word inside `var()`. `%` is not recognized as a part of number, but the leading `-` is. When using minus operator in `calc` function, we must type a space in both sides of `-` (value like `calc(100%-5px)` is wrong), so if we met a pattern like `-[\d.]` in a CSS value (not in selector, rule or variable), it must be the start of a negative number.
Rex Zeng 0cc8c56a 2018-12-03T20:52:13 Identify JavaScript function parameters (#1446) Support parameters for these types of functions: ```javascript // es6 class method foo(x, y) {} // es6 arrow function (x, y) => x x => x // es5 function function foo(x, y) {} // es5 anonymous function function (x, y) {} ```
Masafumi Koba 0c8f6504 2018-12-03T04:37:20 Add file extensions support for major languages (#1478) This adds aliases for file extensions of some major languages. - `coffee` -> `coffeescript` - `md` -> `markdown` - `py` -> `python` - `rb` -> `ruby` - `yml` -> `yaml`
Michael Schmidt 4a8219a4 2018-12-02T19:25:05 Add support for Java stack traces (#1520) There are 3 main types of elements which are highlighted: 1. The summary. This is the head of the stack trace and includes the name of the exception and a message. `Exception in thread "main" java.lang.RuntimeException: A test exception` 2. Stack frames. These make up the actual stack trace and include the full name of the method and the source. `at com.stackify.stacktrace.StackTraceExample.methodB(StackTraceExample.java:13)` 3. Omitted frames. This is a simple message that some frames were omitted. `... 27 more` Everything besides these 3 element types will not be highlighted.
Michael Schmidt a69c2b62 2018-12-02T16:48:53 Improvements to Python F-strings and string prefixes (#1642) This PR adds support for [string interpolation](https://www.python.org/dev/peps/pep-0498/) (aka. f-strings) and makes the [string prefixes](https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals) part of the string. Resolves #1636. ### Known issues Assumes that strings inside the interpolation expression are 'nice'. So strings with unfortunate numbers of curley braces will cause incorrect highlighting: E.g.: `f"{'}'}"`.
Michael Schmidt 5b6ad70d 2018-12-02T16:44:21 Add TOML support (#1488) Add support for [Tom's Obvious, Minimal Language](https://github.com/toml-lang/toml). Some simplifications: 1. The `.`s of dotted keys are not highlighted. This is because the `.` could be inside quotes and checking that isn't easy. 2. There is no distinction between table `[foo]` and array `[[foo]]`. `foo` will be highlighted as `table` in both cases.
Michael Schmidt 2577b6e6 2018-12-02T00:07:24 Add decorator support to Python (#1639) Add support for Python decorators, implementing #1635 using the solution proposed by @spectras. Also add 2 aliases: `annotation` to be like Java and `punctuation` to change the actual color (like Java). This resolves #1635.
Michael Schmidt d33d259c 2018-12-02T00:02:57 Ignore duplicates in insertBefore (#1628) Fix #1525 and implement option number 2.
Cameron Bothner 72775919 2018-12-01T16:38:05 Consistent Ruby method highlighting (#1523) Ruby methods might or might be called in C-style creating inconsistent highlighting. This highlights only method definitions and removes the highlighting of C-style-invoked methods.
Michael Schmidt 2a4758ab 2018-12-01T21:44:57 Improve regex detection in JS (#1473) The pattern for regular expressions in JS now also matches empty character sets and it handles expressions like `/[\]/]/` now correctly.
Michael Schmidt 81bd8f0b 2018-12-01T21:44:17 Improve Java (#1474) A bunch of small improvements for the Java language. 1. Class highlighting based on [naming conventions](http://www.oracle.com/technetwork/java/javase/overview/codeconventions-135099.html). Because of these conventions, we know that every name which starts with an uppercase letter and contains some lower case letters afterward is a class, interface or enum. 2. Nested generics are now supported. The contents of a generic statement are no longer highlighted as a `function`, but as a `class-name` which is more fitting. 3. Packages will now be highlighted as `namespace`. 4. E.g. `foo::bar`, `bar` will be highlighted as a function. 5. ~Support for `var`.~ #1549 6. `null` is now a keyword. As it should be.
Michael Schmidt 3b1e0916 2018-12-01T21:34:04 Improvements to C# operator and punctuation (#1532) Solve the issue of [C# breaking ligature fonts with the `=>` operator](https://github.com/PrismJS/prism/issues/1133#issuecomment-413553956). `=>` is now an operator. There are also some other changes. 1. `?` and `:` are now all included by `punctuation`. Because `:` cannot be included in `operator` (because it is also used for inheritance) the `?` shouldn't be an `operator` either. 2. `??` and `?.` were added to `punctuation`. They weren't explicitly supported before. 3. An operator-test was added.
Michael Schmidt 00bfc969 2018-12-01T21:27:42 Improve F# (#1573) Implement a few F# features: 1. [Attributes](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/attributes). 2. [Computation expressions](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/computation-expressions) (resolves #1459). 3. Class names for type annotations, [casts ](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/casting-and-conversions)(not including `as`), definitions and instancing (resolves #1460). 4. Proper support for ([nullable](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/symbol-and-operator-reference/nullable-operators)) [operators](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/symbol-and-operator-reference/).
Michael Schmidt e2f2fd19 2018-12-01T21:19:37 Reuse CSS selector pattern in CSS Extras (#1637) The CSS extras for the selector now use the CSS selector pattern.
Michael Schmidt b0717e70 2018-12-01T21:09:13 Add support for code blocks in Markdown (#1562) It also supports syntax highlighting! The highlighting is done in two steps: 1. Add an alias `language-****` containing the given language to the `code-block` token. This happens in the `after-tokenize` hook. 2. Highlight the code with the `wrap` hook. This is to get around the encoding (`util.encode`) of tokens in `Prism.highlight`. By using this procedure we get the correct execution of the `before-tokenize`, `after-tokenize`, and `wrap` hook for all included languages.
James DiGioia 1b812386 2018-12-01T13:51:35 CSS: Comma punctuation (#1632) * Show invisibles inside tokens * Revert "Show invisibles inside tokens" This reverts commit 2d622f17e4f6d746e8f4fa211c7f6b7ccb3f27b4. * Added the comma to the list of CSS punctuation
Michael Schmidt 39686e12 2018-12-01T19:51:08 Remove unused `insertBefore` overload (#1631) Mentioned in #1505.
Michael Schmidt c988936b 2018-12-01T19:46:13 Resolved merge conflict
Michael Schmidt 0536fb14 2018-12-01T19:06:04 Move SCSS `property` definition (#1633) This PR cleans up the SCSS language definition a little by moving the definition of `property` inside the `extend` object. Also remove useless `i` flag.
Michael Schmidt 86d31793 2018-12-01T18:58:10 Remove useless insertBefore in LESS (#1629) Remove an `insertBefore` call which was intended to swap the order of `punctuation` and `function`. But as `function` is already before `punctuation` (in [CSS](https://github.com/PrismJS/prism/blob/master/components/prism-css.js#L18)), it doesn't do anything.
Michael Schmidt 1b75da90 2018-12-01T18:46:55 Improved HTTP content highlighting (#1598) Extends the content highlighting capabilities of HTTP. 1. Add support for `application/javascript` and `text/css` content types. 2. Change the languages associated with certain types: 1. `application/json` now uses `json` with `javascript` as a backup instead of just `javascript`. 2. All XML types now use `Prism.languages.xml` instead of `markup`. 3. The HTML type now uses `html` instead of `markup`. 3. Add support for highlighting based on [suffixes](https://en.wikipedia.org/wiki/Media_type#Suffix) for XML and JSON. E.g. `image/svg+xml`, `application/xhtml+xml`, `application/atom+xml` will use `xml` and `application/calendar+json` will use `json`. 4. Stylistic changes: 1. Fix indentation. 2. Use single quotes for token names.
Michael Schmidt 2288c25e 2018-12-01T18:37:20 Add G-code language (#1572) This PR adds the [G-code language](https://reprap.org/wiki/G-code) to Prism and resolves #1571. ### Features - All fields from A-Z ([case sensitive](https://reprap.org/wiki/G-code#Case_sensitivity)) and [checksums](https://reprap.org/wiki/G-code#.2A:_Checksum) (`*`). - [Comments](https://reprap.org/wiki/G-code#Comments) of both the semicolon and parenthesis style. - [Quoted strings](https://reprap.org/wiki/G-code#Quoted_strings). - The colon punctuation of [lists (see the example)](https://reprap.org/wiki/G-code#M584:_Set_drive_mapping).
Michael Schmidt 225dd3f7 2018-11-29T14:07:27 Scheme improvements (#1556) 1. `)` is part for symbols (strings). 2. Function names which have a keyword/builtin as a prefix are not matched correctly. 3. Zero-length function names. 4. `'` is highlighted as `string` even if it marks a list. Also add support for Scheme characters.
Michael Schmidt 1d1fb800 2018-11-29T13:43:22 Python: Operator keywords are now keywords (#1617) Change `and`, `not`, and `or` to keywords.
Ralf Biedert 3590edde 2018-11-29T12:25:28 Add missing keywords to rust. (#1634) Adds `dyn`, `Self`, and `union` to the list of rust keywords.
Starbeamrainbowlabs 38def334 2018-11-28T17:45:17 Add new language: CIL (#1593) Add support for the Common Intermediate Language from .NET.
Michael Schmidt c6584290 2018-11-28T16:12:09 Fixed Markdown headers (#1557) This PR fixed markdown header of the form: ``` Überschrift ----------- ```
Michael Schmidt 2864fe24 2018-11-28T14:54:29 Improve `Prism.util.type` performance (#1545) Drop the regex in favor of a faster `slice` call.
Andre Hotzler a2230c38 2018-11-28T14:26:31 Add additional commands to bash (#1577) Includes "apt", "apt-cache" or "parted" and others.
Michael Schmidt 9d2fddc2 2018-11-28T14:21:20 Added strike support to markdown (#1563) This PR adds support for the strike operator in [both forms][1]. It does not include actual styling for the strike operator as it makes the ~ character really hard to read. [1]: https://webapps.stackexchange.com/questions/14986/strikethrough-with-github-markdown/103691#103691