forked from highlightjs/highlight.js
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merge master #3
Merged
Merged
merge master #3
Conversation
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
* fix(parser) fixes sublanguage with no rule matches Resolves #2504.
* (chore) eslint:recommended * (chore): eslint_standard * relax eslint rules for language grammars (to discourage rewriting them in one fell swoop; I'd rather have the blame history intact) * remove extra escaping * clean up variables * more camelcase
* YAML parse non-word characters as part of tags * adds support for verbatim tags Co-authored-by: Josh Goebel <[email protected]>
…2502) * fix(javascript/typescript): lambda with parens in parameters fails - Fixes both JavaScript and TypeScript grammars Fixes samples like: const bad = ((a, b) => [...a, b]); sides.every((length,width=(3+2+(4/5))) => length > 0 ); This is done by counting parens in the regex that finds arrows functions. Currently we can only handle 2 levels of nesting as shown in the second example above. * allow much richer highlighting inside params * improve highlighting inside arguments on typescript
PR #1897 switched C++ raw strings to use backreferences, however this breaks souce files where raw strings are truncated. Like comments, it would be preferable to highlight them. - Add `on:begin` and `on:end` to allow more granular matching when then end match is dynamic and based on a part of the begin match - This deprecates the `endSameAsBegin` attribute. That attribute was a very specific way to solve this problem, but now we have a much more general solution in these added callbacks. Also related: #2259. Co-authored-by: Josh Goebel <[email protected]>
Adds a mode helper to replace the deprecated `endSameAsBegin` attribute. The first match group from the begin regex will be compared to the first match group from the end regex and the end regex will only match if both strings are identical. Note this is more advanced functionality than before since now you can match a larger selection of text yet only use a small portion of it for the actual "end must match begin" portion.
- even if that existing behavior is questionable - the ending span should really close before the $$, not after Fixing this would involve delving into the sublanguage behavior and I'm not sure we have time to tackle that right this moment.
- I can never find this file because it's name didn't fully match. - rename callbacks to `on:begin` and `on:end`
Builds a common keyword foundation for any grammar that is building on top of JavaScript: - LiveScript - CoffeeScript - TypeScript Also uses this common foundation for JS itself.
* Use containers to match inline sequences and mappings * Add string type for inside inline elements * Handle nested inline sequences and mappings * Disallow all braces brackets and commas from strings inside inline mappings or sequences * clean up implementation * feed the linter Co-authored-by: Josh Goebel <[email protected]>
* (build) browser build is CommonJS and IIFE (global) now * (build) dropping support for AMD, which we never truly supported properly in the first place * (build) add test to make sure browser build works as commonJS module Resolves #2505
* fix[parser] add edge case handle for illegal 0 width matches * add last ditch catch all that tries to detect other uncaught freezes
- (docs) Add syntax highlighting for Rails Unicorn logging to supported languages.
- (parser) Adds `keywords.$pattern` key to grammar definitions - `lexemes` is now deprecated in favor of `keywords.$pattern` key - enh(typescript) use identifier to match potential keywords, preventing false positives - enh(javascript) use identifier to match potential keywords, preventing false positives
* make the object attr container smarter * deal with multi-line comments also * comments in any order, spanning multiple lines Essentially makes the object attr container much more sensitive by allowing it to look-ahead thru comments to find object keys - and therefore prevent them from being incorrectly matched by the "value container" rule.
* Add hljs.registerAlias(alias, languageName) public API * Add .registerAlias() test
…#2554) * (erlang) add support for underscore separators in numeric literals * (erlang) add tests
Adds JSDoc annotations and a .tsconfig that allows TypeScript to be run in it's "allowJS" mode and apply type and sanity checking to JavaScript code also. See Type Checking JavaScript Files. I've been using TypeScript a lot lately and finding it very beneficial and wanted to get those same benefits here but without converting the whole project to TypeScript. It was rough at the beginning but now that this is finished I think it's about 80%-90% of the benefits without any of the TS compilation pipeline. The big difference in being JSDoc for adding typing information vs inline types with TypeScript. Should be super helpful for maintainers using an editor with tight TypeScript integration and the improved docs/comments should help everyone else. - Adds types/index.d.ts to NPM build (should be useful for TypeScript peeps) - Improves documentation of many functions - Adds JSDoc annotations to almost all functions - Adds JSDoc type annotations to variables that can't be inferred - Refactors a few smaller things to allow the TypeScript compiler to better infer what is happening (and usually also made the code clearer)
…, block-parameters and literals (#2344) - `htmlbars` grammar is now deprecated. Use `handlebars` instead. A stub is included so that anyone literally referencing the old `htmlbars` file (say manually requiring it in Node.js, etc) is still covered, but everyone should transition to `handlebars` now.
* fix(groovy) strings are not allowed inside ternary clauses * whitespace can also include tabs
* chore(package): update @typescript-eslint/parser to version 3.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Josh Goebel <[email protected]>
* chore(package): update @typescript-eslint/eslint-plugin to version 3.0.0 * chore(package): update lockfile package-lock.json Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Josh Goebel <[email protected]>
* escape quotes also in final HTML output * [style] update test coding style * update markup tests with new escaping This shouldn't be a security issue -- we've always escaped double quotes inside of HTML attribute values (where they could be used to break out of context) - and we've always used double quotes for enclosing attribute values. This just goes all the way and now properly escapes quotes everywhere. Better safe than sorry.
- Added support for many additional types of floating point literals - Added related tests There still may be a few gaps, but this is a pretty large improvement. Co-authored-by: Josh Goebel <[email protected]>
Co-authored-by: Vladimir Jimenez <[email protected]>
Adds file extensions to all import specifiers in ./src/ files. This is useful to run the files straight from source with a web browser , Node.js ESM or Deno. - Also add eslint rules regarding extensions for imports
* Dart: allow built-in nullable types with trailing ? to be highlighted
- fixes tiny style issues - adds `npm run lint` for linting the main library source (not languages which are still much messier)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.