diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f787fe86f9..97bb5b10b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,8 +8,14 @@ on: - "*beta*" - "1[0-9]+.[0-9]+.[0-9]+" +permissions: + contents: read + jobs: prerelease: + permissions: + contents: write # for git push + name: Release runs-on: ubuntu-latest steps: diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01429794df..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: node_js -node_js: - - "lts/*" - - "node" -env: - # we current only test "use strict" for our NPM builds - - BUILD=node TEST_STRICT_BUNDLE=1 - - BUILD=browser - - BUILD=browser NO_MINIFY=1 -script: - - | - export BUILD_PARAMS="-t $BUILD" - - if [ "x$NO_MINIFY" = "x1" ]; then - export BUILD_PARAMS="$BUILD_PARAMS -n" - fi - - node tools/build.js $BUILD_PARAMS - - # test that our build is "use strict" safe for use with packaging - # systems importing our source thru ES6 modules (rollup, etc.) - if [ "x$TEST_STRICT_BUNDLE" = "x1" ]; then - ./node_modules/.bin/rollup -c test/builds/rollup_import_via_commonjs.js - node build/bundle.js || exit 1 - rm build/bundle.js - fi - - if [ "x$BUILD" = "xnode" ]; then - npm run test - else - npm run test-browser || exit 1 - # our browser build should also work fine as a Node.js CommonJS module - node test/builds/browser_build_as_commonjs.js - fi -sudo: false # Use container-based architecture diff --git a/CHANGES.md b/CHANGES.md index d73e78fa60..a239d1fa98 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,44 @@ +## Version 11.7.0 + +New Grammars: + +- added 3rd party LookML grammar to SUPPORTED_LANGUAGES [Josh Temple][] +- added 3rd party FunC grammar to SUPPORTED_LANGUAGES [Nikita Sobolev][] +- Added 3rd party Flix grammar to SUPPORTED_LANGUAGES [The Flix Organisation][] +- Added 3rd party RVT grammar to SUPPORTED_LANGUAGES [Sopitive][] + +Grammars: + +- enh(scheme) add `scm` alias for Scheme [matyklug18][] +- fix(typescript) patterns like ` -![build and CI status](https://badgen.net/github/checks/highlightjs/highlight.js/main?label=build) +[![ci status](https://badgen.net/github/checks/highlightjs/highlight.js/main?label=build)](https://github.com/highlightjs/highlight.js/actions/workflows/tests.js.yml) [![code quality](https://badgen.net/lgtm/grade/g/highlightjs/highlight.js/js?label=code+quality)](https://lgtm.com/projects/g/highlightjs/highlight.js/?mode=list) [![vulnerabilities](https://badgen.net/snyk/highlightjs/highlight.js)](https://snyk.io/test/github/highlightjs/highlight.js?targetFile=package.json) ![dev deps](https://badgen.net/david/dev/highlightjs/highlight.js?label=dev+deps) @@ -328,20 +327,20 @@ see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ````html - + @@ -353,20 +352,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` @@ -376,20 +375,20 @@ hljs.registerLanguage('go', go); ##### Common JS ```html - - + + - + ``` ##### ES6 Modules ```html - + ``` diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index a8c5278053..60a834d162 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -41,6 +41,7 @@ The table below shows the full list of languages (and corresponding classes/alia | C/AL | cal | | | Cache Object Script | cos, cls | | | CMake | cmake, cmake.in | | +| COBOL | cobol, standard-cobol | [highlightjs-cobol](https://github.com/otterkit/highlightjs-cobol) | | Coq | coq | | | CSP | csp | | | CSS | css | | @@ -76,7 +77,9 @@ The table below shows the full list of languages (and corresponding classes/alia | Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) | | F# | fsharp, fs | | | FIX | fix | | +| Flix | flix | [highlightjs-flix](https://github.com/flix/highlightjs-flix) | | Fortran | fortran, f90, f95 | | +| FunC | func | [highlightjs-func](https://github.com/highlightjs/highlightjs-func) | | G-Code | gcode, nc | | | Gams | gams, gms | | | GAUSS | gauss, gss | | @@ -117,6 +120,7 @@ The table below shows the full list of languages (and corresponding classes/alia | Lisp | lisp | | | LiveCode Server | livecodeserver | | | LiveScript | livescript, ls | | +| LookML | lookml | [highlightjs-lookml](https://github.com/spectacles-ci/highlightjs-lookml) | | Lua | lua | | | Macaulay2 | macaulay2 | [highlightjs-macaulay2](https://github.com/d-torrance/highlightjs-macaulay2) | | Makefile | makefile, mk, mak, make | | @@ -180,6 +184,7 @@ The table below shows the full list of languages (and corresponding classes/alia | RPM spec files | rpm-specfile, rpm, spec, rpm-spec, specfile | [highlightjs-rpm-specfile](https://github.com/highlightjs/highlightjs-rpm-specfile) | | Ruby | ruby, rb, gemspec, podspec, thor, irb | | | Rust | rust, rs | | +| RVT Script | rvt, rvt-script | [highlightjs-rvt-script](https://github.com/Sopitive/highlightjs-rvt-script) | | SAS | SAS, sas | | | SCSS | scss | | | SQL | sql | | @@ -210,7 +215,7 @@ The table below shows the full list of languages (and corresponding classes/alia | TP | tp | | | Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) | | Twig | twig, craftcms | | -| TypeScript | typescript, ts | | +| TypeScript | typescript, ts, tsx | | | Unicorn Rails log | unicorn-rails-log | [highlightjs-unicorn-rails-log](https://github.com/sweetppro/highlightjs-unicorn-rails-log) | | VB.Net | vbnet, vb | | | VBA | vba | [highlightjs-vba](https://github.com/dullin/highlightjs-vba) | diff --git a/docs/api.rst b/docs/api.rst index f4301a2889..fc5c9dc81e 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -15,7 +15,7 @@ highlight Core highlighting function. Accepts the code to highlight (string) and a list of options (object). The ``language`` parameter must be present and specify the language name or alias of the grammar to be used for highlighting. -The ``ignoreIllegals`` is an optional parameter than when true forces highlighting +The ``ignoreIllegals`` is an optional parameter that when ``true`` forces highlighting to finish even in case of detecting illegal syntax for the language instead of throwing an exception. diff --git a/docs/conf.py b/docs/conf.py index cc3cf1a1bd..b111ed9bf3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -53,7 +53,7 @@ # built documents. # The full version, including alpha/beta/rc tags. -release = '11.6.0' +release = '11.7.0' # The short X.Y version. version = ".".join(release.split(".")[:2]) diff --git a/package-lock.json b/package-lock.json index 5e18692e2a..53fa144c56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "highlight.js", - "version": "11.6.0", + "version": "11.7.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "highlight.js", - "version": "11.6.0", + "version": "11.7.0", "license": "BSD-3-Clause", "devDependencies": { "@colors/colors": "^1.5.0", @@ -3906,9 +3906,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz", - "integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", + "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.2", @@ -7236,9 +7236,9 @@ "dev": true }, "terser": { - "version": "5.14.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.1.tgz", - "integrity": "sha512-+ahUAE+iheqBTDxXhTisdA8hgvbEG1hHOQ9xmNjeUJSoi6DU/gMrKNcfZjHkyY6Alnuyc+ikYJaxxfHkT3+WuQ==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.1.tgz", + "integrity": "sha512-K1faMUvpm/FBxjBXud0LWVAGxmvoPbZbfTCYbSgaaYQaIXI3/TdI7a7ZGA73Zrou6Q8Zmz3oeUTsp/dj+ag2Xw==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.2", diff --git a/package.json b/package.json index 9af5ce8189..2ab70f829f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "syntax" ], "homepage": "https://highlightjs.org/", - "version": "11.6.0", + "version": "11.7.0", "author": "Josh Goebel ", "contributors": [ "Josh Goebel ", diff --git a/src/languages/bash.js b/src/languages/bash.js index 38a08e0432..9d8c00bf0e 100644 --- a/src/languages/bash.js +++ b/src/languages/bash.js @@ -70,7 +70,7 @@ export default function(hljs) { end: /'/ }; const ARITHMETIC = { - begin: /\$\(\(/, + begin: /\$?\(\(/, end: /\)\)/, contains: [ { diff --git a/src/languages/cmake.js b/src/languages/cmake.js index dddbfc0dde..e5ba49b8cc 100644 --- a/src/languages/cmake.js +++ b/src/languages/cmake.js @@ -52,6 +52,7 @@ export default function(hljs) { begin: /\$\{/, end: /\}/ }, + hljs.COMMENT(/#\[\[/, /]]/), hljs.HASH_COMMENT_MODE, hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE diff --git a/src/languages/java.js b/src/languages/java.js index 9a0cf137f5..cdbb1e9f94 100644 --- a/src/languages/java.js +++ b/src/languages/java.js @@ -72,7 +72,9 @@ export default function(hljs) { 'requires', 'exports', 'do', - 'sealed' + 'sealed', + 'yield', + 'permits' ]; const BUILT_INS = [ diff --git a/src/languages/javascript.js b/src/languages/javascript.js index 1b1ff4c30e..e999cc66fe 100644 --- a/src/languages/javascript.js +++ b/src/languages/javascript.js @@ -47,7 +47,8 @@ export default function(hljs) { nextChar === "<" || // the , gives away that this is not HTML // `` - nextChar === ",") { + nextChar === "," + ) { response.ignoreMatch(); return; } @@ -65,10 +66,18 @@ export default function(hljs) { // `` (self-closing) // handled by simpleSelfClosing rule - // `` - // technically this could be HTML, but it smells like a type let m; const afterMatch = match.input.substring(afterMatchIndex); + + // some more template typing stuff + // (key?: string) => Modify< + if ((m = afterMatch.match(/^\s*=/))) { + response.ignoreMatch(); + return; + } + + // `` + // technically this could be HTML, but it smells like a type // NOTE: This is ugh, but added specifically for https://github.com/highlightjs/highlight.js/issues/3276 if ((m = afterMatch.match(/^\s+extends\s+/))) { if (m.index === 0) { @@ -211,6 +220,8 @@ export default function(hljs) { HTML_TEMPLATE, CSS_TEMPLATE, TEMPLATE_STRING, + // Skip numbers when they are part of a variable name + { match: /\$\d+/ }, NUMBER, // This is intentional: // See https://github.com/highlightjs/highlight.js/issues/3288 @@ -360,7 +371,8 @@ export default function(hljs) { /\b/, noneOf([ ...ECMAScript.BUILT_IN_GLOBALS, - "super" + "super", + "import" ]), IDENT_RE, regex.lookahead(/\(/)), className: "title.function", @@ -443,6 +455,8 @@ export default function(hljs) { CSS_TEMPLATE, TEMPLATE_STRING, COMMENT, + // Skip numbers when they are part of a variable name + { match: /\$\d+/ }, NUMBER, CLASS_REFERENCE, { diff --git a/src/languages/markdown.js b/src/languages/markdown.js index 427f6eab22..7d5a15062f 100644 --- a/src/languages/markdown.js +++ b/src/languages/markdown.js @@ -138,11 +138,11 @@ export default function(hljs) { contains: [], // defined later variants: [ { - begin: /_{2}/, + begin: /_{2}(?!\s)/, end: /_{2}/ }, { - begin: /\*{2}/, + begin: /\*{2}(?!\s)/, end: /\*{2}/ } ] @@ -152,11 +152,11 @@ export default function(hljs) { contains: [], // defined later variants: [ { - begin: /\*(?!\*)/, + begin: /\*(?![*\s])/, end: /\*/ }, { - begin: /_(?!_)/, + begin: /_(?![_\s])/, end: /_/, relevance: 0 } diff --git a/src/languages/nix.js b/src/languages/nix.js index 27232ec7a8..5f7eceae4f 100644 --- a/src/languages/nix.js +++ b/src/languages/nix.js @@ -45,6 +45,10 @@ export default function(hljs) { end: /\}/, keywords: KEYWORDS }; + const ESCAPED_DOLLAR = { + className: 'char.escape', + begin: /''\$/, + }; const ATTRS = { begin: /[a-zA-Z0-9-_]+(\s*=)/, returnBegin: true, @@ -59,7 +63,7 @@ export default function(hljs) { }; const STRING = { className: 'string', - contains: [ ANTIQUOTE ], + contains: [ ESCAPED_DOLLAR, ANTIQUOTE ], variants: [ { begin: "''", diff --git a/src/languages/routeros.js b/src/languages/routeros.js index feee347a26..025fdc481f 100644 --- a/src/languages/routeros.js +++ b/src/languages/routeros.js @@ -1,5 +1,5 @@ /* -Language: Microtik RouterOS script +Language: MikroTik RouterOS script Author: Ivan Dementev Description: Scripting host provides a way to automate some router maintenance tasks by means of executing user-defined scripts bounded to some event occurrence Website: https://wiki.mikrotik.com/wiki/Manual:Scripting @@ -67,7 +67,7 @@ export default function(hljs) { const IPADDR_wBITMASK = IPADDR + '/(3[0-2]|[1-2][0-9]|\\d)'; return { - name: 'Microtik RouterOS script', + name: 'MikroTik RouterOS script', aliases: [ 'mikrotik' ], case_insensitive: true, keywords: { diff --git a/src/languages/ruby.js b/src/languages/ruby.js index 0504039a0a..07af86ed33 100644 --- a/src/languages/ruby.js +++ b/src/languages/ruby.js @@ -18,10 +18,23 @@ export default function(hljs) { ) ; const CLASS_NAME_WITH_NAMESPACE_RE = regex.concat(CLASS_NAME_RE, /(::\w+)*/) + // very popular ruby built-ins that one might even assume + // are actual keywords (despite that not being the case) + const PSEUDO_KWS = [ + "include", + "extend", + "prepend", + "public", + "private", + "protected", + "raise", + "throw" + ]; const RUBY_KEYWORDS = { "variable.constant": [ "__FILE__", - "__LINE__" + "__LINE__", + "__ENCODING__" ], "variable.language": [ "self", @@ -30,9 +43,6 @@ export default function(hljs) { keyword: [ "alias", "and", - "attr_accessor", - "attr_reader", - "attr_writer", "begin", "BEGIN", "break", @@ -48,7 +58,6 @@ export default function(hljs) { "for", "if", "in", - "include", "module", "next", "not", @@ -65,10 +74,17 @@ export default function(hljs) { "when", "while", "yield", + ...PSEUDO_KWS ], built_in: [ "proc", - "lambda" + "lambda", + "attr_accessor", + "attr_reader", + "attr_writer", + "define_method", + "private_constant", + "module_function" ], literal: [ "true", @@ -227,6 +243,17 @@ export default function(hljs) { ] }; + const INCLUDE_EXTEND = { + match: [ + /(include|extend)\s+/, + CLASS_NAME_WITH_NAMESPACE_RE + ], + scope: { + 2: "title.class" + }, + keywords: RUBY_KEYWORDS + }; + const CLASS_DEFINITION = { variants: [ { @@ -239,7 +266,7 @@ export default function(hljs) { }, { match: [ - /class\s+/, + /\b(class|module)\s+/, CLASS_NAME_WITH_NAMESPACE_RE ] } @@ -275,18 +302,27 @@ export default function(hljs) { relevance: 0, match: [ CLASS_NAME_WITH_NAMESPACE_RE, - /\.new[ (]/ + /\.new[. (]/ ], scope: { 1: "title.class" } }; + // CamelCase + const CLASS_REFERENCE = { + relevance: 0, + match: CLASS_NAME_RE, + scope: "title.class" + }; + const RUBY_DEFAULT_CONTAINS = [ STRING, CLASS_DEFINITION, + INCLUDE_EXTEND, OBJECT_CREATION, UPPER_CASE_CONSTANT, + CLASS_REFERENCE, METHOD_DEFINITION, { // swallow namespace qualifiers before symbols diff --git a/src/languages/scheme.js b/src/languages/scheme.js index e8f4669886..b344fc1ff2 100644 --- a/src/languages/scheme.js +++ b/src/languages/scheme.js @@ -186,6 +186,7 @@ export default function(hljs) { return { name: 'Scheme', + aliases: ['scm'], illegal: /\S/, contains: [ hljs.SHEBANG(), diff --git a/src/lib/compile_keywords.js b/src/lib/compile_keywords.js index 31d9a7fb17..d5ff87e898 100644 --- a/src/lib/compile_keywords.js +++ b/src/lib/compile_keywords.js @@ -22,7 +22,7 @@ const DEFAULT_KEYWORD_SCOPE = "keyword"; * @param {boolean} caseInsensitive */ export function compileKeywords(rawKeywords, caseInsensitive, scopeName = DEFAULT_KEYWORD_SCOPE) { - /** @type KeywordDict */ + /** @type {import("highlight.js/private").KeywordDict} */ const compiledKeywords = Object.create(null); // input can be a string of keywords, an array of keywords, or a object with diff --git a/src/styles/routeros.css b/src/styles/routeros.css index 5bbf4ca14a..21fbdd5f02 100644 --- a/src/styles/routeros.css +++ b/src/styles/routeros.css @@ -1,6 +1,6 @@ /* - highlight.js style for Microtik RouterOS script + highlight.js style for MikroTik RouterOS script */ diff --git a/test/builds/package.js b/test/builds/package.js index eaff262ce0..9edaa6778d 100644 --- a/test/builds/package.js +++ b/test/builds/package.js @@ -2,7 +2,7 @@ This file is used by import_via_commonjs.js to build a single "package" and acts as a sanity check that all our code is "use strict" safe -See .travis.yml +See .github/workflows/tests.js.yml */ import hljs from '../../build/lib/index.js'; diff --git a/test/markup/bash/arithmetic.expect.txt b/test/markup/bash/arithmetic.expect.txt index 28ebd37413..573b97aa29 100644 --- a/test/markup/bash/arithmetic.expect.txt +++ b/test/markup/bash/arithmetic.expect.txt @@ -6,3 +6,11 @@ yumi=deadbeef B=20 yumi=deadbeef echo $(( $B#$yumi / 1003 )) + +# test that << within an expression doesn't false positively as a heredoc... +(( 19 << 42 )) +printf 'Line 1\n' +printf 'Line 2\n' + +fubar=42 +(( x = 19 * fubar / 2 )) diff --git a/test/markup/bash/arithmetic.txt b/test/markup/bash/arithmetic.txt index d44dea465e..e6a87ca7a0 100644 --- a/test/markup/bash/arithmetic.txt +++ b/test/markup/bash/arithmetic.txt @@ -6,3 +6,11 @@ echo $(( 16#$yumi / 1003 )) B=20 yumi=deadbeef echo $(( $B#$yumi / 1003 )) + +# test that << within an expression doesn't false positively as a heredoc... +(( 19 << 42 )) +printf 'Line 1\n' +printf 'Line 2\n' + +fubar=42 +(( x = 19 * fubar / 2 )) diff --git a/test/markup/cmake/default.expect.txt b/test/markup/cmake/default.expect.txt index 638923c572..fd6c45401d 100644 --- a/test/markup/cmake/default.expect.txt +++ b/test/markup/cmake/default.expect.txt @@ -17,3 +17,7 @@ add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) + +#[[This is a bracket comment. +It runs until the close bracket.]] +message("First Argument\n" #[[Bracket Comment]] "Second Argument") diff --git a/test/markup/cmake/default.txt b/test/markup/cmake/default.txt index 2bbea38c9d..1f4d7faa69 100644 --- a/test/markup/cmake/default.txt +++ b/test/markup/cmake/default.txt @@ -17,3 +17,7 @@ find_package(Qt5Widgets REQUIRED) add_executable(myproject main.cpp mainwindow.cpp) qt5_use_modules(myproject Widgets) + +#[[This is a bracket comment. +It runs until the close bracket.]] +message("First Argument\n" #[[Bracket Comment]] "Second Argument") diff --git a/test/markup/haml/default.expect.txt b/test/markup/haml/default.expect.txt index 7a422eb11f..486ea2a173 100644 --- a/test/markup/haml/default.expect.txt +++ b/test/markup/haml/default.expect.txt @@ -11,4 +11,4 @@ =variable2 ~ variable3 ~variable4 - The current year is #{DataTime.now.year}. + The current year is #{DataTime.now.year}. diff --git a/test/markup/http/default.expect.txt b/test/markup/http/default.expect.txt index 73c696acff..06f037c0c5 100644 --- a/test/markup/http/default.expect.txt +++ b/test/markup/http/default.expect.txt @@ -4,4 +4,4 @@ Content-Length: 19 {"status": "ok", "extended": true} - + \ No newline at end of file diff --git a/test/markup/java/switch.expect.txt b/test/markup/java/switch.expect.txt new file mode 100644 index 0000000000..63950d1ad8 --- /dev/null +++ b/test/markup/java/switch.expect.txt @@ -0,0 +1,13 @@ +switch(a) { + case null -> yield "n"; + case String s -> yield "s"; + case Object o -> yield "o"; + default: yield "d", +} + +switch(a) { + case null: return "n"; + case "s": return "s"; + case "o": return "o"; + default: return "d"; +} diff --git a/test/markup/java/switch.txt b/test/markup/java/switch.txt new file mode 100644 index 0000000000..de7fd24061 --- /dev/null +++ b/test/markup/java/switch.txt @@ -0,0 +1,13 @@ +switch(a) { + case null -> yield "n"; + case String s -> yield "s"; + case Object o -> yield "o"; + default: yield "d", +} + +switch(a) { + case null: return "n"; + case "s": return "s"; + case "o": return "o"; + default: return "d"; +} diff --git a/test/markup/java/titles.expect.txt b/test/markup/java/titles.expect.txt index 2043511c9a..5162edadf6 100644 --- a/test/markup/java/titles.expect.txt +++ b/test/markup/java/titles.expect.txt @@ -9,7 +9,7 @@ } } -sealed interface Command permits LoginCommand { +sealed interface Command permits LoginCommand { void run(); } diff --git a/test/markup/javascript/modules.expect.txt b/test/markup/javascript/modules.expect.txt index 0e1b5dad7d..4ddf183b9f 100644 --- a/test/markup/javascript/modules.expect.txt +++ b/test/markup/javascript/modules.expect.txt @@ -6,3 +6,5 @@ //------ main.js ------ import _, { each, something as otherthing } from 'underscore'; + +const file = import("https://file.io/file.js") diff --git a/test/markup/javascript/modules.txt b/test/markup/javascript/modules.txt index c0c8e35606..71651d339e 100644 --- a/test/markup/javascript/modules.txt +++ b/test/markup/javascript/modules.txt @@ -6,3 +6,5 @@ export function something() {}; //------ main.js ------ import _, { each, something as otherthing } from 'underscore'; + +const file = import("https://file.io/file.js") diff --git a/test/markup/javascript/numbers.expect.txt b/test/markup/javascript/numbers.expect.txt index 1fd58c42fa..f15c1081d6 100644 --- a/test/markup/javascript/numbers.expect.txt +++ b/test/markup/javascript/numbers.expect.txt @@ -75,3 +75,24 @@ x0.e1 0b1e1 0N 00. + +// numbers in identifiers +const num = $1 +const num = $0n9 +const num = $abc012 +const num = $0x9 +const num = $0o0 +const num = $09 +const num = $9.09 +const num = $a9 +const num = 1 +const num = 0n9 +const num = 0x9 +const num = 0o0 +const num = 09 +const num = 9.09 +const num = a9 + +// numbers in identifiers in template strings +cosnt string = `${$0}` +cosnt string = `${0}` diff --git a/test/markup/javascript/numbers.txt b/test/markup/javascript/numbers.txt index 05baf74710..daa651082b 100644 --- a/test/markup/javascript/numbers.txt +++ b/test/markup/javascript/numbers.txt @@ -75,3 +75,24 @@ x0.e1 0b1e1 0N 00. + +// numbers in identifiers +const num = $1 +const num = $0n9 +const num = $abc012 +const num = $0x9 +const num = $0o0 +const num = $09 +const num = $9.09 +const num = $a9 +const num = 1 +const num = 0n9 +const num = 0x9 +const num = 0o0 +const num = 09 +const num = 9.09 +const num = a9 + +// numbers in identifiers in template strings +cosnt string = `${$0}` +cosnt string = `${0}` diff --git a/test/markup/markdown/bold_italics.expect.txt b/test/markup/markdown/bold_italics.expect.txt index ddc8a59558..a08ae07756 100644 --- a/test/markup/markdown/bold_italics.expect.txt +++ b/test/markup/markdown/bold_italics.expect.txt @@ -19,3 +19,15 @@ ***This is bold and italic*** ___This is bold and italic___ + +** i shouldn't be italic** + +* and I shouldn't be italic either* + +__ not really bold__ + +_ not italic_ + +> * One (this point is italic) +> * Two +> * Three diff --git a/test/markup/markdown/bold_italics.txt b/test/markup/markdown/bold_italics.txt index 5f15ea0d7b..c85202e554 100644 --- a/test/markup/markdown/bold_italics.txt +++ b/test/markup/markdown/bold_italics.txt @@ -19,3 +19,15 @@ __Bold *then italic*__ ***This is bold and italic*** ___This is bold and italic___ + +** i shouldn't be italic** + +* and I shouldn't be italic either* + +__ not really bold__ + +_ not italic_ + +> * One (this point is italic) +> * Two +> * Three diff --git a/test/markup/nix/default.expect.txt b/test/markup/nix/default.expect.txt index 97d6b3cb6a..bd90c5c422 100644 --- a/test/markup/nix/default.expect.txt +++ b/test/markup/nix/default.expect.txt @@ -16,6 +16,7 @@ postInstall = '' ${ if true then "--${test}" else false } + ''${ escaped } ''; meta = with stdenv.lib; { diff --git a/test/markup/nix/default.txt b/test/markup/nix/default.txt index ae8b8f7531..21b2080ae9 100644 --- a/test/markup/nix/default.txt +++ b/test/markup/nix/default.txt @@ -16,6 +16,7 @@ in stdenv.mkDerivation rec { postInstall = '' ${ if true then "--${test}" else false } + ''${ escaped } ''; meta = with stdenv.lib; { diff --git a/test/markup/ruby/prompt.expect.txt b/test/markup/ruby/prompt.expect.txt index bef182b866..a2242b73d1 100644 --- a/test/markup/ruby/prompt.expect.txt +++ b/test/markup/ruby/prompt.expect.txt @@ -28,9 +28,9 @@ irb(main):004:1* end irb(main):005:0> end => :[] -irb(main):006:0> Secret.new[0] +irb(main):006:0> Secret.new[0] => nil -irb(main):008:0> Secret.new[2239232] +irb(main):008:0> Secret.new[2239232] => nil -irb(main):009:0> Secret.new[42] +irb(main):009:0> Secret.new[42] => "TREASURE" diff --git a/test/markup/typescript/generics.expect.txt b/test/markup/typescript/generics.expect.txt new file mode 100644 index 0000000000..8b7705bff6 --- /dev/null +++ b/test/markup/typescript/generics.expect.txt @@ -0,0 +1,10 @@ +import { useWeb3React as useWeb3React_ } from '@web3-react/core' + +export const useWeb3React: <T = any>(key?: string) => Modify< + ReturnType<typeof useWeb3React_<T>>, + { chainId: SupportedChainIds } +> = useWeb3React_ as any + +declare global { + type SupportedChainIds = 1 | 4 +} diff --git a/test/markup/typescript/generics.txt b/test/markup/typescript/generics.txt new file mode 100644 index 0000000000..218c5f0ddc --- /dev/null +++ b/test/markup/typescript/generics.txt @@ -0,0 +1,10 @@ +import { useWeb3React as useWeb3React_ } from '@web3-react/core' + +export const useWeb3React: (key?: string) => Modify< + ReturnType>, + { chainId: SupportedChainIds } +> = useWeb3React_ as any + +declare global { + type SupportedChainIds = 1 | 4 +}