Skip to content

Commit

Permalink
Merge branch 'master' into escapeHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed May 18, 2020
2 parents 4edd388 + 63f367c commit 8401cfd
Show file tree
Hide file tree
Showing 66 changed files with 1,056 additions and 178 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Expand Up @@ -17,6 +17,10 @@ module.exports = {
"ecmaVersion": 2018,
"sourceType": "module"
},
"parser": '@typescript-eslint/parser',
"plugins": [
"@typescript-eslint"
],
"rules": {
"array-callback-return": "error",
"block-scoped-var": "error",
Expand All @@ -27,7 +31,7 @@ module.exports = {
// for now ignore diff between types of quoting
"quotes": "off",
// this is the style we are already using
"operator-linebreak": ["error","after", { "overrides": { "?": "after", ":": "after" } }],
"operator-linebreak": ["error","before", { "overrides": { "?": "after", ":": "after", "+": "after" } }],
// sometimes we declare variables with extra spacing
"indent": ["error", 2, {"VariableDeclarator":2}],
// seems like a good idea not to use explicit undefined
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Expand Up @@ -13,6 +13,8 @@ Parser Engine:

Deprecations:

- when using `highlightBlock` `result.re` deprecated. Use `result.relevance` instead. (#2552) [Josh Goebel][]
- ditto for `result.second_best.re` => `result.second_best.relevance` (#2552)
- `lexemes` is now deprecated in favor of `keywords.$pattern` key (#2519) [Josh Goebel][]
- `endSameAsBegin` is now deprecated. (#2261) [Josh Goebel][]

Expand All @@ -34,6 +36,7 @@ Language Improvements:
- fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][]
- fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][]
- enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][]
- enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][]

[Josh Goebel]: https://github.com/yyyc514
[Peter Plantinga]: https://github.com/pplantinga
Expand All @@ -42,6 +45,7 @@ Language Improvements:
[Hankun Lin]: https://github.com/Linhk1606
[Nick Randall]: https://github.com/nicked
[Sam Rawlins]: https://github.com/srawlins
[Sergey Prokhorov]: https://github.com/seriyps


## Version 10.0.2
Expand Down
1 change: 1 addition & 0 deletions SUPPORTED_LANGUAGES.md
Expand Up @@ -92,6 +92,7 @@ Languages that listed a **Package** below are 3rd party languages and are not bu
| JSON | json | |
| Java | java, jsp | |
| JavaScript | javascript, js, jsx | |
| Jolie | jolie, iol, ol | [highlightjs-jolie](https://github.com/xiroV/highlightjs-jolie) |
| Kotlin | kotlin, kt | |
| LaTeX | tex | |
| Leaf | leaf | |
Expand Down
6 changes: 3 additions & 3 deletions docs/api.rst
Expand Up @@ -101,13 +101,13 @@ Applies highlighting to all ``<pre><code>...</code></pre>`` blocks on a page.
Attaches highlighting to the page load event.


``registerLanguage(name, language)``
``registerLanguage(languageName, languageDefinition)``
------------------------------------

Adds new language to the library under the specified name. Used mostly internally.

* ``name``: a string with the name of the language being registered
* ``language``: a function that returns an object which represents the
* ``languageName``: a string with the name of the language being registered
* ``languageDefinition``: a function that returns an object which represents the
language definition. The function is passed the ``hljs`` object to be able
to use common regular expressions defined within it.

Expand Down
119 changes: 119 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Expand Up @@ -21,14 +21,13 @@
"url": "git://github.com/highlightjs/highlight.js.git"
},
"main": "./lib/index.js",
"types": "./types/index.d.ts",
"scripts": {
"mocha": "mocha",

"build_and_test": "npm run build && npm run test",
"build": "node ./tools/build.js -t node",
"build-cdn": "node ./tools/build.js -t cdn",
"build-browser": "node ./tools/build.js -t browser :common",

"test": "mocha --globals document test",
"test-markup": "mocha --globals document test/markup",
"test-detect": "mocha --globals document test/detect",
Expand All @@ -38,6 +37,8 @@
"node": "*"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^2.32.0",
"@typescript-eslint/parser": "^2.32.0",
"clean-css": "^4.2.1",
"cli-table": "^0.3.1",
"colors": "^1.1.2",
Expand All @@ -62,7 +63,8 @@
"rollup-plugin-json": "^4.0.0",
"should": "^13.2.3",
"terser": "^4.3.9",
"tiny-worker": "^2.3.0"
"tiny-worker": "^2.3.0",
"typescript": "^4.0.0-dev.20200512"
},
"dependencies": {}
}

0 comments on commit 8401cfd

Please sign in to comment.