Repository: highlightjs/highlight.js Branch: main Commit: 5697ae518774 Files: 1875 Total size: 4.2 MB Directory structure: gitextract_6r0dturf/ ├── .dockerignore ├── .editorconfig ├── .eslintrc.js ├── .eslintrc.lang.js ├── .git-blame-ignore-revs ├── .gitattributes ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── 1_incorrect-syntax-highlighting.md │ │ ├── bug_report.md │ │ ├── config.yml │ │ ├── feature_request.md │ │ └── z_request_language_repo.md │ ├── dependabot.yml │ ├── pull_request_template.md │ └── workflows/ │ ├── lint.yml │ ├── release.yml │ ├── size_report_comment.yml │ └── size_report_create.yml ├── .gitignore ├── .mocharc.json ├── .readthedocs.yaml ├── .tokeignore ├── CHANGES.md ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── Dockerfile ├── LICENSE ├── MAINTAINERS_GUIDE.md ├── README.CDN.md ├── README.md ├── SECURITY.md ├── SUPPORTED_LANGUAGES.md ├── VERSION_10_BREAKING_CHANGES.md ├── VERSION_10_UPGRADE.md ├── VERSION_11_UPGRADE.md ├── demo/ │ ├── demo.js │ ├── index.html │ ├── readme.md │ └── style.css ├── docs/ │ ├── Makefile │ ├── _static/ │ │ └── .gitkeep │ ├── _templates/ │ │ └── .gitkeep │ ├── api.rst │ ├── building-testing.rst │ ├── conf.py │ ├── css-classes-reference.rst │ ├── index.rst │ ├── language-contribution.rst │ ├── language-guide.rst │ ├── language-requests.rst │ ├── line-numbers.rst │ ├── mode-reference.rst │ ├── plugin-api.rst │ ├── plugin-recipes.rst │ ├── requirements.txt │ └── theme-guide.rst ├── package.json ├── src/ │ ├── core.d.ts │ ├── highlight.js │ ├── languages/ │ │ ├── 1c.js │ │ ├── abnf.js │ │ ├── accesslog.js │ │ ├── actionscript.js │ │ ├── ada.js │ │ ├── angelscript.js │ │ ├── apache.js │ │ ├── applescript.js │ │ ├── arcade.js │ │ ├── arduino.js │ │ ├── armasm.js │ │ ├── asciidoc.js │ │ ├── aspectj.js │ │ ├── autohotkey.js │ │ ├── autoit.js │ │ ├── avrasm.js │ │ ├── awk.js │ │ ├── axapta.js │ │ ├── bash.js │ │ ├── basic.js │ │ ├── bnf.js │ │ ├── brainfuck.js │ │ ├── c.js │ │ ├── cal.js │ │ ├── capnproto.js │ │ ├── ceylon.js │ │ ├── clean.js │ │ ├── clojure-repl.js │ │ ├── clojure.js │ │ ├── cmake.js │ │ ├── coffeescript.js │ │ ├── coq.js │ │ ├── cos.js │ │ ├── cpp.js │ │ ├── crmsh.js │ │ ├── crystal.js │ │ ├── csharp.js │ │ ├── csp.js │ │ ├── css.js │ │ ├── d.js │ │ ├── dart.js │ │ ├── delphi.js │ │ ├── diff.js │ │ ├── django.js │ │ ├── dns.js │ │ ├── dockerfile.js │ │ ├── dos.js │ │ ├── dsconfig.js │ │ ├── dts.js │ │ ├── dust.js │ │ ├── ebnf.js │ │ ├── elixir.js │ │ ├── elm.js │ │ ├── erb.js │ │ ├── erlang-repl.js │ │ ├── erlang.js │ │ ├── excel.js │ │ ├── fix.js │ │ ├── flix.js │ │ ├── fortran.js │ │ ├── fsharp.js │ │ ├── gams.js │ │ ├── gauss.js │ │ ├── gcode.js │ │ ├── gherkin.js │ │ ├── glsl.js │ │ ├── gml.js │ │ ├── go.js │ │ ├── golo.js │ │ ├── gradle.js │ │ ├── graphql.js │ │ ├── groovy.js │ │ ├── haml.js │ │ ├── handlebars.js │ │ ├── haskell.js │ │ ├── haxe.js │ │ ├── hsp.js │ │ ├── http.js │ │ ├── hy.js │ │ ├── inform7.js │ │ ├── ini.js │ │ ├── irpf90.js │ │ ├── isbl.js │ │ ├── java.js │ │ ├── javascript.js │ │ ├── jboss-cli.js │ │ ├── json.js │ │ ├── julia-repl.js │ │ ├── julia.js │ │ ├── kotlin.js │ │ ├── lasso.js │ │ ├── latex.js │ │ ├── ldif.js │ │ ├── leaf.js │ │ ├── less.js │ │ ├── lib/ │ │ │ ├── css-shared.js │ │ │ ├── ecmascript.js │ │ │ ├── java.js │ │ │ ├── kws_swift.js │ │ │ └── mathematica.js │ │ ├── lisp.js │ │ ├── livecodeserver.js │ │ ├── livescript.js │ │ ├── llvm.js │ │ ├── lsl.js │ │ ├── lua.js │ │ ├── makefile.js │ │ ├── markdown.js │ │ ├── mathematica.js │ │ ├── matlab.js │ │ ├── maxima.js │ │ ├── mel.js │ │ ├── mercury.js │ │ ├── mipsasm.js │ │ ├── mizar.js │ │ ├── mojolicious.js │ │ ├── monkey.js │ │ ├── moonscript.js │ │ ├── n1ql.js │ │ ├── nestedtext.js │ │ ├── nginx.js │ │ ├── nim.js │ │ ├── nix.js │ │ ├── node-repl.js │ │ ├── nsis.js │ │ ├── objectivec.js │ │ ├── ocaml.js │ │ ├── openscad.js │ │ ├── oxygene.js │ │ ├── parser3.js │ │ ├── perl.js │ │ ├── pf.js │ │ ├── pgsql.js │ │ ├── php-template.js │ │ ├── php.js │ │ ├── plaintext.js │ │ ├── pony.js │ │ ├── powershell.js │ │ ├── processing.js │ │ ├── profile.js │ │ ├── prolog.js │ │ ├── properties.js │ │ ├── protobuf.js │ │ ├── puppet.js │ │ ├── purebasic.js │ │ ├── python-repl.js │ │ ├── python.js │ │ ├── q.js │ │ ├── qml.js │ │ ├── r.js │ │ ├── reasonml.js │ │ ├── rib.js │ │ ├── roboconf.js │ │ ├── routeros.js │ │ ├── rsl.js │ │ ├── ruby.js │ │ ├── ruleslanguage.js │ │ ├── rust.js │ │ ├── sas.js │ │ ├── scala.js │ │ ├── scheme.js │ │ ├── scilab.js │ │ ├── scss.js │ │ ├── shell.js │ │ ├── smali.js │ │ ├── smalltalk.js │ │ ├── sml.js │ │ ├── sqf.js │ │ ├── sql.js │ │ ├── stan.js │ │ ├── stata.js │ │ ├── step21.js │ │ ├── stylus.js │ │ ├── subunit.js │ │ ├── swift.js │ │ ├── taggerscript.js │ │ ├── tap.js │ │ ├── tcl.js │ │ ├── thrift.js │ │ ├── tp.js │ │ ├── twig.js │ │ ├── typescript.js │ │ ├── vala.js │ │ ├── vbnet.js │ │ ├── vbscript-html.js │ │ ├── vbscript.js │ │ ├── verilog.js │ │ ├── vhdl.js │ │ ├── vim.js │ │ ├── wasm.js │ │ ├── wren.js │ │ ├── x86asm.js │ │ ├── xl.js │ │ ├── xml.js │ │ ├── xquery.js │ │ ├── yaml.js │ │ └── zephir.js │ ├── lib/ │ │ ├── compile_keywords.js │ │ ├── compiler_extensions.js │ │ ├── ext/ │ │ │ └── multi_class.js │ │ ├── exts/ │ │ │ └── before_match.js │ │ ├── html_injection_error.js │ │ ├── html_renderer.js │ │ ├── logger.js │ │ ├── mode_compiler.js │ │ ├── modes.js │ │ ├── regex.js │ │ ├── response.js │ │ ├── token_tree.js │ │ └── utils.js │ ├── stub.js │ └── styles/ │ ├── 1c-light.css │ ├── a11y-dark.css │ ├── a11y-light.css │ ├── agate.css │ ├── an-old-hope.css │ ├── androidstudio.css │ ├── arduino-light.css │ ├── arta.css │ ├── ascetic.css │ ├── atom-one-dark-reasonable.css │ ├── atom-one-dark.css │ ├── atom-one-light.css │ ├── base16/ │ │ ├── 3024.css │ │ ├── apathy.css │ │ ├── apprentice.css │ │ ├── ashes.css │ │ ├── atelier-cave-light.css │ │ ├── atelier-cave.css │ │ ├── atelier-dune-light.css │ │ ├── atelier-dune.css │ │ ├── atelier-estuary-light.css │ │ ├── atelier-estuary.css │ │ ├── atelier-forest-light.css │ │ ├── atelier-forest.css │ │ ├── atelier-heath-light.css │ │ ├── atelier-heath.css │ │ ├── atelier-lakeside-light.css │ │ ├── atelier-lakeside.css │ │ ├── atelier-plateau-light.css │ │ ├── atelier-plateau.css │ │ ├── atelier-savanna-light.css │ │ ├── atelier-savanna.css │ │ ├── atelier-seaside-light.css │ │ ├── atelier-seaside.css │ │ ├── atelier-sulphurpool-light.css │ │ ├── atelier-sulphurpool.css │ │ ├── atlas.css │ │ ├── bespin.css │ │ ├── black-metal-bathory.css │ │ ├── black-metal-burzum.css │ │ ├── black-metal-dark-funeral.css │ │ ├── black-metal-gorgoroth.css │ │ ├── black-metal-immortal.css │ │ ├── black-metal-khold.css │ │ ├── black-metal-marduk.css │ │ ├── black-metal-mayhem.css │ │ ├── black-metal-nile.css │ │ ├── black-metal-venom.css │ │ ├── black-metal.css │ │ ├── brewer.css │ │ ├── bright.css │ │ ├── brogrammer.css │ │ ├── brush-trees-dark.css │ │ ├── brush-trees.css │ │ ├── chalk.css │ │ ├── circus.css │ │ ├── classic-dark.css │ │ ├── classic-light.css │ │ ├── codeschool.css │ │ ├── colors.css │ │ ├── cupcake.css │ │ ├── cupertino.css │ │ ├── danqing.css │ │ ├── darcula.css │ │ ├── dark-violet.css │ │ ├── darkmoss.css │ │ ├── darktooth.css │ │ ├── decaf.css │ │ ├── default-dark.css │ │ ├── default-light.css │ │ ├── dirtysea.css │ │ ├── dracula.css │ │ ├── edge-dark.css │ │ ├── edge-light.css │ │ ├── eighties.css │ │ ├── embers.css │ │ ├── equilibrium-dark.css │ │ ├── equilibrium-gray-dark.css │ │ ├── equilibrium-gray-light.css │ │ ├── equilibrium-light.css │ │ ├── espresso.css │ │ ├── eva-dim.css │ │ ├── eva.css │ │ ├── flat.css │ │ ├── framer.css │ │ ├── fruit-soda.css │ │ ├── gigavolt.css │ │ ├── github.css │ │ ├── google-dark.css │ │ ├── google-light.css │ │ ├── grayscale-dark.css │ │ ├── grayscale-light.css │ │ ├── green-screen.css │ │ ├── gruvbox-dark-hard.css │ │ ├── gruvbox-dark-medium.css │ │ ├── gruvbox-dark-pale.css │ │ ├── gruvbox-dark-soft.css │ │ ├── gruvbox-light-hard.css │ │ ├── gruvbox-light-medium.css │ │ ├── gruvbox-light-soft.css │ │ ├── hardcore.css │ │ ├── harmonic16-dark.css │ │ ├── harmonic16-light.css │ │ ├── heetch-dark.css │ │ ├── heetch-light.css │ │ ├── helios.css │ │ ├── hopscotch.css │ │ ├── horizon-dark.css │ │ ├── horizon-light.css │ │ ├── humanoid-dark.css │ │ ├── humanoid-light.css │ │ ├── ia-dark.css │ │ ├── ia-light.css │ │ ├── icy-dark.css │ │ ├── ir-black.css │ │ ├── isotope.css │ │ ├── kimber.css │ │ ├── london-tube.css │ │ ├── macintosh.css │ │ ├── marrakesh.css │ │ ├── materia.css │ │ ├── material-darker.css │ │ ├── material-lighter.css │ │ ├── material-palenight.css │ │ ├── material-vivid.css │ │ ├── material.css │ │ ├── mellow-purple.css │ │ ├── mexico-light.css │ │ ├── mocha.css │ │ ├── monokai.css │ │ ├── nebula.css │ │ ├── nord.css │ │ ├── nova.css │ │ ├── ocean.css │ │ ├── oceanicnext.css │ │ ├── one-light.css │ │ ├── onedark.css │ │ ├── outrun-dark.css │ │ ├── papercolor-dark.css │ │ ├── papercolor-light.css │ │ ├── paraiso.css │ │ ├── pasque.css │ │ ├── phd.css │ │ ├── pico.css │ │ ├── pop.css │ │ ├── porple.css │ │ ├── qualia.css │ │ ├── railscasts.css │ │ ├── rebecca.css │ │ ├── ros-pine-dawn.css │ │ ├── ros-pine-moon.css │ │ ├── ros-pine.css │ │ ├── sagelight.css │ │ ├── sandcastle.css │ │ ├── seti-ui.css │ │ ├── shapeshifter.css │ │ ├── silk-dark.css │ │ ├── silk-light.css │ │ ├── snazzy.css │ │ ├── solar-flare-light.css │ │ ├── solar-flare.css │ │ ├── solarized-dark.css │ │ ├── solarized-light.css │ │ ├── spacemacs.css │ │ ├── summercamp.css │ │ ├── summerfruit-dark.css │ │ ├── summerfruit-light.css │ │ ├── synth-midnight-terminal-dark.css │ │ ├── synth-midnight-terminal-light.css │ │ ├── tango.css │ │ ├── tender.css │ │ ├── tomorrow-night.css │ │ ├── tomorrow.css │ │ ├── twilight.css │ │ ├── unikitty-dark.css │ │ ├── unikitty-light.css │ │ ├── vulcan.css │ │ ├── windows-10-light.css │ │ ├── windows-10.css │ │ ├── windows-95-light.css │ │ ├── windows-95.css │ │ ├── windows-high-contrast-light.css │ │ ├── windows-high-contrast.css │ │ ├── windows-nt-light.css │ │ ├── windows-nt.css │ │ ├── woodland.css │ │ ├── xcode-dusk.css │ │ └── zenburn.css │ ├── brown-paper.css │ ├── codepen-embed.css │ ├── color-brewer.css │ ├── cybertopia-cherry.css │ ├── cybertopia-dimmer.css │ ├── cybertopia-icecap.css │ ├── cybertopia-saturated.css │ ├── dark.css │ ├── default.css │ ├── devibeans.css │ ├── docco.css │ ├── far.css │ ├── felipec.css │ ├── foundation.css │ ├── github-dark-dimmed.css │ ├── github-dark.css │ ├── github.css │ ├── gml.css │ ├── googlecode.css │ ├── gradient-dark.css │ ├── gradient-light.css │ ├── grayscale.css │ ├── hybrid.css │ ├── idea.css │ ├── intellij-light.css │ ├── ir-black.css │ ├── isbl-editor-dark.css │ ├── isbl-editor-light.css │ ├── kimbie-dark.css │ ├── kimbie-light.css │ ├── lightfair.css │ ├── lioshi.css │ ├── magula.css │ ├── mono-blue.css │ ├── monokai-sublime.css │ ├── monokai.css │ ├── night-owl.css │ ├── nnfx-dark.css │ ├── nnfx-light.css │ ├── nord.css │ ├── obsidian.css │ ├── panda-syntax-dark.css │ ├── panda-syntax-light.css │ ├── paraiso-dark.css │ ├── paraiso-light.css │ ├── pojoaque.css │ ├── purebasic.css │ ├── qtcreator-dark.css │ ├── qtcreator-light.css │ ├── rainbow.css │ ├── rose-pine-dawn.css │ ├── rose-pine-moon.css │ ├── rose-pine.css │ ├── routeros.css │ ├── school-book.css │ ├── shades-of-purple.css │ ├── srcery.css │ ├── stackoverflow-dark.css │ ├── stackoverflow-light.css │ ├── sunburst.css │ ├── tokyo-night-dark.css │ ├── tokyo-night-light.css │ ├── tomorrow-night-blue.css │ ├── tomorrow-night-bright.css │ ├── vs-dark.css │ ├── vs.css │ ├── vs2015.css │ ├── xcode.css │ └── xt256.css ├── test/ │ ├── api/ │ │ ├── autoDetection.js │ │ ├── beginKeywords.js │ │ ├── binaryNumber.js │ │ ├── cNumber.js │ │ ├── getLanguage.js │ │ ├── highlight.js │ │ ├── ident.js │ │ ├── index.js │ │ ├── keywords.js │ │ ├── multiClassMatch.js │ │ ├── number.js │ │ ├── registerAlias.js │ │ ├── starters.js │ │ ├── underscoreIdent.js │ │ └── unregisterLanguage.js │ ├── browser/ │ │ ├── highlight_block_callbacks.js │ │ ├── index.js │ │ ├── plain.js │ │ └── worker.js │ ├── builds/ │ │ ├── browser_build_as_commonjs.js │ │ ├── cdn_build_as_esm.mjs │ │ ├── node_build_as_esm.mjs │ │ ├── package.js │ │ ├── rollup_import_cdn_build_esm.mjs │ │ ├── rollup_import_node_build_esm.mjs │ │ └── rollup_import_via_commonjs.mjs │ ├── detect/ │ │ ├── 1c/ │ │ │ └── default.txt │ │ ├── abnf/ │ │ │ └── default.txt │ │ ├── accesslog/ │ │ │ └── default.txt │ │ ├── actionscript/ │ │ │ └── default.txt │ │ ├── ada/ │ │ │ └── default.txt │ │ ├── angelscript/ │ │ │ └── default.txt │ │ ├── apache/ │ │ │ └── default.txt │ │ ├── applescript/ │ │ │ └── default.txt │ │ ├── arcade/ │ │ │ └── default.txt │ │ ├── arduino/ │ │ │ └── default.txt │ │ ├── armasm/ │ │ │ └── default.txt │ │ ├── asciidoc/ │ │ │ └── default.txt │ │ ├── aspectj/ │ │ │ └── default.txt │ │ ├── autohotkey/ │ │ │ └── default.txt │ │ ├── autoit/ │ │ │ └── default.txt │ │ ├── avrasm/ │ │ │ └── default.txt │ │ ├── awk/ │ │ │ └── default.txt │ │ ├── axapta/ │ │ │ └── default.txt │ │ ├── bash/ │ │ │ └── default.txt │ │ ├── basic/ │ │ │ └── default.txt │ │ ├── bnf/ │ │ │ └── default.txt │ │ ├── brainfuck/ │ │ │ └── default.txt │ │ ├── cal/ │ │ │ └── default.txt │ │ ├── capnproto/ │ │ │ └── default.txt │ │ ├── ceylon/ │ │ │ └── default.txt │ │ ├── clean/ │ │ │ └── default.txt │ │ ├── clojure/ │ │ │ └── default.txt │ │ ├── clojure-repl/ │ │ │ └── default.txt │ │ ├── cmake/ │ │ │ └── default.txt │ │ ├── coffeescript/ │ │ │ └── default.txt │ │ ├── coq/ │ │ │ └── default.txt │ │ ├── cos/ │ │ │ └── default.txt │ │ ├── cpp/ │ │ │ └── default.txt │ │ ├── crmsh/ │ │ │ └── default.txt │ │ ├── crystal/ │ │ │ └── default.txt │ │ ├── csharp/ │ │ │ └── default.txt │ │ ├── csp/ │ │ │ └── default.txt │ │ ├── css/ │ │ │ └── default.txt │ │ ├── d/ │ │ │ └── default.txt │ │ ├── dart/ │ │ │ └── default.txt │ │ ├── delphi/ │ │ │ └── default.txt │ │ ├── diff/ │ │ │ └── default.txt │ │ ├── django/ │ │ │ └── default.txt │ │ ├── dns/ │ │ │ └── default.txt │ │ ├── dockerfile/ │ │ │ └── default.txt │ │ ├── dos/ │ │ │ └── default.txt │ │ ├── dsconfig/ │ │ │ └── default.txt │ │ ├── dts/ │ │ │ └── default.txt │ │ ├── dust/ │ │ │ └── default.txt │ │ ├── ebnf/ │ │ │ └── default.txt │ │ ├── elixir/ │ │ │ └── default.txt │ │ ├── elm/ │ │ │ └── default.txt │ │ ├── erb/ │ │ │ └── default.txt │ │ ├── erlang/ │ │ │ └── default.txt │ │ ├── erlang-repl/ │ │ │ └── default.txt │ │ ├── excel/ │ │ │ └── default.txt │ │ ├── fix/ │ │ │ └── default.txt │ │ ├── flix/ │ │ │ └── default.txt │ │ ├── fortran/ │ │ │ └── default.txt │ │ ├── fsharp/ │ │ │ └── default.txt │ │ ├── gams/ │ │ │ └── default.txt │ │ ├── gauss/ │ │ │ └── default.txt │ │ ├── gcode/ │ │ │ └── default.txt │ │ ├── gherkin/ │ │ │ └── default.txt │ │ ├── glsl/ │ │ │ └── default.txt │ │ ├── gml/ │ │ │ └── default.txt │ │ ├── go/ │ │ │ ├── default.txt │ │ │ └── swift-like.txt │ │ ├── golo/ │ │ │ └── default.txt │ │ ├── gradle/ │ │ │ └── default.txt │ │ ├── graphql/ │ │ │ └── default.txt │ │ ├── groovy/ │ │ │ └── default.txt │ │ ├── haml/ │ │ │ └── default.txt │ │ ├── handlebars/ │ │ │ └── default.txt │ │ ├── haskell/ │ │ │ └── default.txt │ │ ├── haxe/ │ │ │ └── default.txt │ │ ├── hsp/ │ │ │ └── default.txt │ │ ├── http/ │ │ │ └── default.txt │ │ ├── hy/ │ │ │ └── default.txt │ │ ├── index.js │ │ ├── inform7/ │ │ │ └── default.txt │ │ ├── ini/ │ │ │ └── default.txt │ │ ├── irpf90/ │ │ │ └── default.txt │ │ ├── isbl/ │ │ │ └── default.txt │ │ ├── java/ │ │ │ └── default.txt │ │ ├── javascript/ │ │ │ ├── default.txt │ │ │ ├── sample1.txt │ │ │ └── short-plain.txt │ │ ├── jboss-cli/ │ │ │ └── default.txt │ │ ├── json/ │ │ │ └── default.txt │ │ ├── json5/ │ │ │ └── default.txt │ │ ├── julia/ │ │ │ └── default.txt │ │ ├── julia-repl/ │ │ │ └── default.txt │ │ ├── kotlin/ │ │ │ └── default.txt │ │ ├── lasso/ │ │ │ └── default.txt │ │ ├── latex/ │ │ │ └── default.txt │ │ ├── ldif/ │ │ │ └── default.txt │ │ ├── leaf/ │ │ │ └── default.txt │ │ ├── less/ │ │ │ └── default.txt │ │ ├── lisp/ │ │ │ └── default.txt │ │ ├── livecodeserver/ │ │ │ └── default.txt │ │ ├── livescript/ │ │ │ └── default.txt │ │ ├── llvm/ │ │ │ └── default.txt │ │ ├── lsl/ │ │ │ └── default.txt │ │ ├── lua/ │ │ │ └── default.txt │ │ ├── makefile/ │ │ │ └── default.txt │ │ ├── markdown/ │ │ │ └── default.txt │ │ ├── mathematica/ │ │ │ └── default.txt │ │ ├── matlab/ │ │ │ └── default.txt │ │ ├── maxima/ │ │ │ └── default.txt │ │ ├── mel/ │ │ │ └── default.txt │ │ ├── mercury/ │ │ │ └── default.txt │ │ ├── mipsasm/ │ │ │ └── default.txt │ │ ├── mizar/ │ │ │ └── default.txt │ │ ├── mojolicious/ │ │ │ └── default.txt │ │ ├── monkey/ │ │ │ └── default.txt │ │ ├── moonscript/ │ │ │ └── default.txt │ │ ├── n1ql/ │ │ │ └── default.txt │ │ ├── nestedtext/ │ │ │ └── default.txt │ │ ├── nginx/ │ │ │ └── default.txt │ │ ├── nim/ │ │ │ └── default.txt │ │ ├── nix/ │ │ │ └── default.txt │ │ ├── node-repl/ │ │ │ └── default.txt │ │ ├── nsis/ │ │ │ └── default.txt │ │ ├── objectivec/ │ │ │ └── default.txt │ │ ├── ocaml/ │ │ │ └── default.txt │ │ ├── openscad/ │ │ │ └── default.txt │ │ ├── oxygene/ │ │ │ └── default.txt │ │ ├── parser3/ │ │ │ └── default.txt │ │ ├── perl/ │ │ │ └── default.txt │ │ ├── pf/ │ │ │ └── default.txt │ │ ├── pgsql/ │ │ │ └── default.txt │ │ ├── php/ │ │ │ └── default.txt │ │ ├── php-template/ │ │ │ └── default.txt │ │ ├── plaintext/ │ │ │ └── default.txt │ │ ├── pony/ │ │ │ └── default.txt │ │ ├── powershell/ │ │ │ └── default.txt │ │ ├── processing/ │ │ │ └── default.txt │ │ ├── profile/ │ │ │ └── default.txt │ │ ├── prolog/ │ │ │ └── default.txt │ │ ├── properties/ │ │ │ └── default.txt │ │ ├── protobuf/ │ │ │ └── default.txt │ │ ├── puppet/ │ │ │ └── default.txt │ │ ├── purebasic/ │ │ │ └── default.txt │ │ ├── python/ │ │ │ └── default.txt │ │ ├── python-repl/ │ │ │ └── default.txt │ │ ├── q/ │ │ │ └── default.txt │ │ ├── qml/ │ │ │ └── default.txt │ │ ├── r/ │ │ │ └── default.txt │ │ ├── reasonml/ │ │ │ └── default.txt │ │ ├── rib/ │ │ │ └── default.txt │ │ ├── roboconf/ │ │ │ └── default.txt │ │ ├── routeros/ │ │ │ └── default.txt │ │ ├── rsl/ │ │ │ └── default.txt │ │ ├── ruby/ │ │ │ ├── default.txt │ │ │ └── double-colon.txt │ │ ├── ruleslanguage/ │ │ │ └── default.txt │ │ ├── rust/ │ │ │ └── default.txt │ │ ├── sas/ │ │ │ └── default.txt │ │ ├── scala/ │ │ │ └── default.txt │ │ ├── scheme/ │ │ │ └── default.txt │ │ ├── scilab/ │ │ │ └── default.txt │ │ ├── scss/ │ │ │ └── default.txt │ │ ├── shell/ │ │ │ └── default.txt │ │ ├── smali/ │ │ │ └── default.txt │ │ ├── smalltalk/ │ │ │ └── default.txt │ │ ├── sml/ │ │ │ └── default.txt │ │ ├── sqf/ │ │ │ └── default.txt │ │ ├── sql/ │ │ │ └── default.txt │ │ ├── stan/ │ │ │ └── default.txt │ │ ├── stata/ │ │ │ └── default.txt │ │ ├── step21/ │ │ │ └── default.txt │ │ ├── stylus/ │ │ │ └── default.txt │ │ ├── subunit/ │ │ │ └── default.txt │ │ ├── swift/ │ │ │ └── default.txt │ │ ├── taggerscript/ │ │ │ └── default.txt │ │ ├── tap/ │ │ │ └── default.txt │ │ ├── tcl/ │ │ │ └── default.txt │ │ ├── thrift/ │ │ │ └── default.txt │ │ ├── tp/ │ │ │ └── default.txt │ │ ├── twig/ │ │ │ └── default.txt │ │ ├── typescript/ │ │ │ └── default.txt │ │ ├── vala/ │ │ │ └── default.txt │ │ ├── vbnet/ │ │ │ └── default.txt │ │ ├── vbscript/ │ │ │ └── default.txt │ │ ├── vbscript-html/ │ │ │ └── default.txt │ │ ├── verilog/ │ │ │ └── default.txt │ │ ├── vhdl/ │ │ │ └── default.txt │ │ ├── vim/ │ │ │ └── default.txt │ │ ├── wasm/ │ │ │ └── default.txt │ │ ├── wren/ │ │ │ └── default.txt │ │ ├── x86asm/ │ │ │ └── default.txt │ │ ├── xl/ │ │ │ └── default.txt │ │ ├── xml/ │ │ │ ├── default.txt │ │ │ ├── groovy-julia.txt │ │ │ └── js.txt │ │ ├── xquery/ │ │ │ └── default.txt │ │ ├── yaml/ │ │ │ └── default.txt │ │ └── zephir/ │ │ └── default.txt │ ├── fixtures/ │ │ ├── expect/ │ │ │ ├── endsWithParentVariants.txt │ │ │ ├── explicit1.txt │ │ │ ├── explicit2.txt │ │ │ ├── languagealias.txt │ │ │ ├── sublanguages.txt │ │ │ └── useBr.txt │ │ ├── index.html │ │ └── nested.js │ ├── index.js │ ├── markup/ │ │ ├── 1c/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── abnf/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── accesslog/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── actionscript/ │ │ │ ├── method-call.expect.txt │ │ │ └── method-call.txt │ │ ├── ada/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── angelscript/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── apache/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── applescript/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── arcade/ │ │ │ ├── profile.expect.txt │ │ │ └── profile.txt │ │ ├── arduino/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── armasm/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── asciidoc/ │ │ │ ├── constrained.expect.txt │ │ │ ├── constrained.txt │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── unconstrained.expect.txt │ │ │ └── unconstrained.txt │ │ ├── aspectj/ │ │ │ ├── intertype-constructor.expect.txt │ │ │ ├── intertype-constructor.txt │ │ │ ├── intertype-method.expect.txt │ │ │ └── intertype-method.txt │ │ ├── autohotkey/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── autoit/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── avrasm/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── awk/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── axapta/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── bash/ │ │ │ ├── arithmetic.expect.txt │ │ │ ├── arithmetic.txt │ │ │ ├── escaped-apos.expect.txt │ │ │ ├── escaped-apos.txt │ │ │ ├── escaped-quote.expect.txt │ │ │ ├── escaped-quote.txt │ │ │ ├── no-numbers.expect.txt │ │ │ ├── no-numbers.txt │ │ │ ├── not-comments.expect.txt │ │ │ ├── not-comments.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── token-containing-keyword.expect.txt │ │ │ ├── token-containing-keyword.txt │ │ │ ├── variables.expect.txt │ │ │ └── variables.txt │ │ ├── basic/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── bnf/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── brainfuck/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── c/ │ │ │ ├── number-literals.expect.txt │ │ │ └── number-literals.txt │ │ ├── cal/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── capnproto/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── ceylon/ │ │ │ ├── nested-comments.expect.txt │ │ │ └── nested-comments.txt │ │ ├── clean/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── clojure/ │ │ │ ├── character.expect.txt │ │ │ ├── character.txt │ │ │ ├── comment-macro.expect.txt │ │ │ ├── comment-macro.txt │ │ │ ├── deps_edn.expect.txt │ │ │ ├── deps_edn.txt │ │ │ ├── globals_definition.expect.txt │ │ │ ├── globals_definition.txt │ │ │ ├── number.expect.txt │ │ │ ├── number.txt │ │ │ ├── symbols-numbers.expect.txt │ │ │ └── symbols-numbers.txt │ │ ├── clojure-repl/ │ │ │ ├── prompt.expect.txt │ │ │ └── prompt.txt │ │ ├── cmake/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── coffeescript/ │ │ │ ├── division.expect.txt │ │ │ ├── division.txt │ │ │ ├── freeze_bug.expect.txt │ │ │ ├── freeze_bug.txt │ │ │ ├── function.expect.txt │ │ │ ├── function.txt │ │ │ ├── regex.expect.txt │ │ │ └── regex.txt │ │ ├── coq/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── cos/ │ │ │ ├── basic.expect.txt │ │ │ ├── basic.txt │ │ │ ├── embedded.expect.txt │ │ │ └── embedded.txt │ │ ├── cpp/ │ │ │ ├── bitwise-keywords.expect.txt │ │ │ ├── bitwise-keywords.txt │ │ │ ├── bugs.expect.txt │ │ │ ├── bugs.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── expression-keywords.expect.txt │ │ │ ├── expression-keywords.txt │ │ │ ├── function-declarations.expect.txt │ │ │ ├── function-declarations.txt │ │ │ ├── function-like-keywords.expect.txt │ │ │ ├── function-like-keywords.txt │ │ │ ├── function-params.expect.txt │ │ │ ├── function-params.txt │ │ │ ├── function-title.expect.txt │ │ │ ├── function-title.txt │ │ │ ├── initializers.expect.txt │ │ │ ├── initializers.txt │ │ │ ├── number-literals.expect.txt │ │ │ ├── number-literals.txt │ │ │ ├── pointers-returns.expect.txt │ │ │ ├── pointers-returns.txt │ │ │ ├── preprocessor.expect.txt │ │ │ ├── preprocessor.txt │ │ │ ├── primitive-types.expect.txt │ │ │ ├── primitive-types.txt │ │ │ ├── string-literals.expect.txt │ │ │ ├── string-literals.txt │ │ │ ├── template-complexity.expect.txt │ │ │ ├── template-complexity.txt │ │ │ ├── truncated-raw-string.expect.txt │ │ │ └── truncated-raw-string.txt │ │ ├── crmsh/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── crystal/ │ │ │ ├── defs.expect.txt │ │ │ ├── defs.txt │ │ │ ├── literals.expect.txt │ │ │ ├── literals.txt │ │ │ ├── macro.expect.txt │ │ │ ├── macro.txt │ │ │ ├── operators.expect.txt │ │ │ ├── operators.txt │ │ │ ├── regexes.expect.txt │ │ │ ├── regexes.txt │ │ │ ├── toplevel-keywords.expect.txt │ │ │ └── toplevel-keywords.txt │ │ ├── csharp/ │ │ │ ├── dotted-namespace.expect.txt │ │ │ ├── dotted-namespace.txt │ │ │ ├── floats.expect.txt │ │ │ ├── floats.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── generic_modifiers.expect.txt │ │ │ ├── generic_modifiers.txt │ │ │ ├── identifiers.expect.txt │ │ │ ├── identifiers.txt │ │ │ ├── records.expect.txt │ │ │ ├── records.txt │ │ │ ├── scoped.expect.txt │ │ │ ├── scoped.txt │ │ │ ├── string-interpolation.expect.txt │ │ │ ├── string-interpolation.txt │ │ │ ├── string-raw.expect.txt │ │ │ ├── string-raw.txt │ │ │ ├── titles.expect.txt │ │ │ ├── titles.txt │ │ │ ├── try-catch.expect.txt │ │ │ └── try-catch.txt │ │ ├── csp/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── css/ │ │ │ ├── css_consistency.expect.txt │ │ │ ├── css_consistency.txt │ │ │ ├── hex-colors.expect.txt │ │ │ ├── hex-colors.txt │ │ │ ├── pseudo-selector.expect.txt │ │ │ ├── pseudo-selector.txt │ │ │ ├── pseudo.expect.txt │ │ │ ├── pseudo.txt │ │ │ ├── sample.expect.txt │ │ │ ├── sample.txt │ │ │ ├── url.expect.txt │ │ │ ├── url.txt │ │ │ ├── variables.expect.txt │ │ │ └── variables.txt │ │ ├── d/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── dart/ │ │ │ ├── comment-markdown.expect.txt │ │ │ ├── comment-markdown.txt │ │ │ ├── string-interpolation.expect.txt │ │ │ └── string-interpolation.txt │ │ ├── delphi/ │ │ │ ├── character-string.expect.txt │ │ │ ├── character-string.txt │ │ │ ├── compiler-directive.expect.txt │ │ │ ├── compiler-directive.txt │ │ │ ├── numeric-literal.expect.txt │ │ │ └── numeric-literal.txt │ │ ├── diff/ │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── git-format-patch.expect.txt │ │ │ └── git-format-patch.txt │ │ ├── django/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── dns/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── dockerfile/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── dos/ │ │ │ ├── comments.expect.txt │ │ │ └── comments.txt │ │ ├── dsconfig/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── dts/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── dust/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── ebnf/ │ │ │ ├── quote-symbols.expect.txt │ │ │ ├── quote-symbols.txt │ │ │ ├── terminators.expect.txt │ │ │ ├── terminators.txt │ │ │ ├── underscore-production.expect.txt │ │ │ └── underscore-production.txt │ │ ├── elixir/ │ │ │ ├── char-literal.expect.txt │ │ │ ├── char-literal.txt │ │ │ ├── conditionals.expect.txt │ │ │ ├── conditionals.txt │ │ │ ├── function-not-regex.expect.txt │ │ │ ├── function-not-regex.txt │ │ │ ├── function-title.expect.txt │ │ │ ├── function-title.txt │ │ │ ├── module-references.expect.txt │ │ │ ├── module-references.txt │ │ │ ├── modules.expect.txt │ │ │ ├── modules.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── sigils.expect.txt │ │ │ ├── sigils.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── uppercase-string-sigil.expect.txt │ │ │ └── uppercase-string-sigil.txt │ │ ├── elm/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── erb/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── erlang/ │ │ │ ├── char_literal.expect.txt │ │ │ ├── char_literal.txt │ │ │ ├── doc_attribute.expect.txt │ │ │ ├── doc_attribute.txt │ │ │ ├── maybe.expect.txt │ │ │ ├── maybe.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── sigil.expect.txt │ │ │ ├── sigil.txt │ │ │ ├── triple_quote_string.expect.txt │ │ │ └── triple_quote_string.txt │ │ ├── erlang-repl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── excel/ │ │ │ ├── comments.expect.txt │ │ │ └── comments.txt │ │ ├── fix/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── flix/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── fortran/ │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── dot_keywords.expect.txt │ │ │ ├── dot_keywords.txt │ │ │ ├── numbers.expect.txt │ │ │ └── numbers.txt │ │ ├── fsharp/ │ │ │ ├── attributes.expect.txt │ │ │ ├── attributes.txt │ │ │ ├── bang-keywords.expect.txt │ │ │ ├── bang-keywords.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── computation-expressions.expect.txt │ │ │ ├── computation-expressions.txt │ │ │ ├── fsi-and-preprocessor.expect.txt │ │ │ ├── fsi-and-preprocessor.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── operators.expect.txt │ │ │ ├── operators.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── types.expect.txt │ │ │ └── types.txt │ │ ├── gams/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── gauss/ │ │ │ ├── function_defs.expect.txt │ │ │ ├── function_defs.txt │ │ │ ├── function_refs.expect.txt │ │ │ ├── function_refs.txt │ │ │ ├── keywords.expect.txt │ │ │ └── keywords.txt │ │ ├── gcode/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── extended.expect.txt │ │ │ └── extended.txt │ │ ├── gherkin/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── glsl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── gml/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── go/ │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── strings.expect.txt │ │ │ └── strings.txt │ │ ├── golo/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── gradle/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── graphql/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── groovy/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── oneoffs.expect.txt │ │ │ └── oneoffs.txt │ │ ├── haml/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── handlebars/ │ │ │ ├── block-expression-variants-as-path-segment.expect.txt │ │ │ ├── block-expression-variants-as-path-segment.txt │ │ │ ├── block-expression-variants-in-helper-name.expect.txt │ │ │ ├── block-expression-variants-in-helper-name.txt │ │ │ ├── block-expression-variants-in-param.expect.txt │ │ │ ├── block-expression-variants-in-param.txt │ │ │ ├── block-parameters-as.expect.txt │ │ │ ├── block-parameters-as.txt │ │ │ ├── block-with-param.expect.txt │ │ │ ├── block-with-param.txt │ │ │ ├── block.expect.txt │ │ │ ├── block.txt │ │ │ ├── built-ins.expect.txt │ │ │ ├── built-ins.txt │ │ │ ├── combinations-with-text.expect.txt │ │ │ ├── combinations-with-text.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── else-variants.expect.txt │ │ │ ├── else-variants.txt │ │ │ ├── escaped-mustaches.expect.txt │ │ │ ├── escaped-mustaches.txt │ │ │ ├── expression-variants.expect.txt │ │ │ ├── expression-variants.txt │ │ │ ├── hashes.expect.txt │ │ │ ├── hashes.txt │ │ │ ├── if-else.expect.txt │ │ │ ├── if-else.txt │ │ │ ├── literals-in-different-places.expect.txt │ │ │ ├── literals-in-different-places.txt │ │ │ ├── literals.expect.txt │ │ │ ├── literals.txt │ │ │ ├── partial-call.expect.txt │ │ │ ├── partial-call.txt │ │ │ ├── path-expressions.expect.txt │ │ │ ├── path-expressions.txt │ │ │ ├── raw-block.expect.txt │ │ │ ├── raw-block.txt │ │ │ ├── simple-expression.expect.txt │ │ │ ├── simple-expression.txt │ │ │ ├── sub-expressions.expect.txt │ │ │ ├── sub-expressions.txt │ │ │ ├── triple-mustache.expect.txt │ │ │ └── triple-mustache.txt │ │ ├── haskell/ │ │ │ ├── char.expect.txt │ │ │ ├── char.txt │ │ │ ├── infix.expect.txt │ │ │ ├── infix.txt │ │ │ ├── inline-comments.expect.txt │ │ │ ├── inline-comments.txt │ │ │ ├── nested-comments.expect.txt │ │ │ ├── nested-comments.txt │ │ │ ├── numbers.expect.txt │ │ │ └── numbers.txt │ │ ├── haxe/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── hsp/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── http/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── http3.expect.txt │ │ │ ├── http3.txt │ │ │ ├── just_headers.expect.txt │ │ │ ├── just_headers.txt │ │ │ ├── response.expect.txt │ │ │ └── response.txt │ │ ├── hy/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── index.js │ │ ├── inform7/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── ini/ │ │ │ ├── array.expect.txt │ │ │ ├── array.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── keys.expect.txt │ │ │ ├── keys.txt │ │ │ ├── tables.expect.txt │ │ │ ├── tables.txt │ │ │ ├── types.expect.txt │ │ │ ├── types.txt │ │ │ ├── variable.expect.txt │ │ │ └── variable.txt │ │ ├── irpf90/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── isbl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── java/ │ │ │ ├── annotations.expect.txt │ │ │ ├── annotations.txt │ │ │ ├── bugs.expect.txt │ │ │ ├── bugs.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── gh1031.expect.txt │ │ │ ├── gh1031.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── switch.expect.txt │ │ │ ├── switch.txt │ │ │ ├── textblock.expect.txt │ │ │ ├── textblock.txt │ │ │ ├── titles.expect.txt │ │ │ └── titles.txt │ │ ├── javascript/ │ │ │ ├── arrow-function.expect.txt │ │ │ ├── arrow-function.txt │ │ │ ├── block-comments.expect.txt │ │ │ ├── block-comments.txt │ │ │ ├── built-in.expect.txt │ │ │ ├── built-in.txt │ │ │ ├── class.expect.txt │ │ │ ├── class.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── conventions.expect.txt │ │ │ ├── conventions.txt │ │ │ ├── default-parameters.expect.txt │ │ │ ├── default-parameters.txt │ │ │ ├── inline-languages.expect.txt │ │ │ ├── inline-languages.txt │ │ │ ├── jsdoc.expect.txt │ │ │ ├── jsdoc.txt │ │ │ ├── jsx-fragment.expect.txt │ │ │ ├── jsx-fragment.txt │ │ │ ├── jsx.expect.txt │ │ │ ├── jsx.txt │ │ │ ├── keyword-as-part-of-method-name.expect.txt │ │ │ ├── keyword-as-part-of-method-name.txt │ │ │ ├── keyword_as_identifier.expect.txt │ │ │ ├── keyword_as_identifier.txt │ │ │ ├── keywords.expect.txt │ │ │ ├── keywords.txt │ │ │ ├── method-call.expect.txt │ │ │ ├── method-call.txt │ │ │ ├── modules.expect.txt │ │ │ ├── modules.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── object-attr.expect.txt │ │ │ ├── object-attr.txt │ │ │ ├── regex.expect.txt │ │ │ ├── regex.txt │ │ │ ├── seperated-parameters.expect.txt │ │ │ ├── seperated-parameters.txt │ │ │ ├── shebang.expect.txt │ │ │ ├── shebang.txt │ │ │ ├── template-strings.expect.txt │ │ │ └── template-strings.txt │ │ ├── jboss-cli/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── json/ │ │ │ ├── comments.expect.txt │ │ │ └── comments.txt │ │ ├── json5/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── julia/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── julia-repl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── kotlin/ │ │ │ ├── class.expect.txt │ │ │ ├── class.txt │ │ │ ├── function.expect.txt │ │ │ ├── function.txt │ │ │ ├── nested_comment.expect.txt │ │ │ ├── nested_comment.txt │ │ │ ├── string.expect.txt │ │ │ └── string.txt │ │ ├── lasso/ │ │ │ ├── delimiters.expect.txt │ │ │ └── delimiters.txt │ │ ├── latex/ │ │ │ ├── chars.expect.txt │ │ │ ├── chars.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── control_sequences.expect.txt │ │ │ ├── control_sequences.txt │ │ │ ├── parameters.expect.txt │ │ │ ├── parameters.txt │ │ │ ├── verbatim.expect.txt │ │ │ └── verbatim.txt │ │ ├── ldif/ │ │ │ ├── ldapmodify.expect.txt │ │ │ ├── ldapmodify.txt │ │ │ ├── schema.expect.txt │ │ │ └── schema.txt │ │ ├── leaf/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── less/ │ │ │ ├── css_consistency.expect.txt │ │ │ ├── css_consistency.txt │ │ │ ├── selectors.expect.txt │ │ │ └── selectors.txt │ │ ├── lisp/ │ │ │ ├── mec.expect.txt │ │ │ └── mec.txt │ │ ├── livecodeserver/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── livescript/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── llvm/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── simple.expect.txt │ │ │ ├── simple.txt │ │ │ ├── string.expect.txt │ │ │ └── string.txt │ │ ├── lsl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── lua/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── makefile/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── markdown/ │ │ │ ├── bold_italics.expect.txt │ │ │ ├── bold_italics.txt │ │ │ ├── code.expect.txt │ │ │ ├── code.txt │ │ │ ├── entity.expect.txt │ │ │ ├── entity.txt │ │ │ ├── links.expect.txt │ │ │ ├── links.txt │ │ │ ├── list.expect.txt │ │ │ ├── list.txt │ │ │ ├── sections.expect.txt │ │ │ └── sections.txt │ │ ├── mathematica/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── matlab/ │ │ │ ├── block_comment.expect.txt │ │ │ ├── block_comment.txt │ │ │ ├── transpose.expect.txt │ │ │ └── transpose.txt │ │ ├── maxima/ │ │ │ ├── example.expect.txt │ │ │ ├── example.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── symbols.expect.txt │ │ │ └── symbols.txt │ │ ├── mel/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── mercury/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── mipsasm/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── mizar/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── mojolicious/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── monkey/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── moonscript/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── n1ql/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── nestedtext/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── lists_of.expect.txt │ │ │ └── lists_of.txt │ │ ├── nginx/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── nim/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── nix/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── node-repl/ │ │ │ ├── sample.expect.txt │ │ │ └── sample.txt │ │ ├── nsis/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── variables.expect.txt │ │ │ └── variables.txt │ │ ├── objectivec/ │ │ │ ├── preprocessor.expect.txt │ │ │ ├── preprocessor.txt │ │ │ ├── string-literals.expect.txt │ │ │ └── string-literals.txt │ │ ├── ocaml/ │ │ │ ├── literals.expect.txt │ │ │ ├── literals.txt │ │ │ ├── types.expect.txt │ │ │ └── types.txt │ │ ├── openscad/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── oxygene/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── parser3/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── perl/ │ │ │ ├── class.expect.txt │ │ │ ├── class.txt │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── number.expect.txt │ │ │ ├── number.txt │ │ │ ├── regex.expect.txt │ │ │ └── regex.txt │ │ ├── pf/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── pgsql/ │ │ │ ├── clauses.expect.txt │ │ │ ├── clauses.txt │ │ │ ├── clauses2.expect.txt │ │ │ ├── clauses2.txt │ │ │ ├── constraints.expect.txt │ │ │ ├── constraints.txt │ │ │ ├── dollar_strings.expect.txt │ │ │ ├── dollar_strings.txt │ │ │ ├── options.expect.txt │ │ │ ├── options.txt │ │ │ ├── plpgsql.expect.txt │ │ │ ├── plpgsql.txt │ │ │ ├── sql-commands.expect.txt │ │ │ ├── sql-commands.txt │ │ │ ├── window-functions.expect.txt │ │ │ ├── window-functions.txt │ │ │ ├── xml.expect.txt │ │ │ └── xml.txt │ │ ├── php/ │ │ │ ├── attributes.expect.txt │ │ │ ├── attributes.txt │ │ │ ├── case.expect.txt │ │ │ ├── case.txt │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── namespace.expect.txt │ │ │ ├── namespace.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── php80.expect.txt │ │ │ ├── php80.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── titles.expect.txt │ │ │ └── titles.txt │ │ ├── php-template/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── plaintext/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── pony/ │ │ │ ├── control-flow.expect.txt │ │ │ ├── control-flow.txt │ │ │ ├── creator.expect.txt │ │ │ ├── creator.txt │ │ │ ├── iterface-trait.expect.txt │ │ │ ├── iterface-trait.txt │ │ │ ├── lambda.expect.txt │ │ │ ├── lambda.txt │ │ │ ├── match.expect.txt │ │ │ ├── match.txt │ │ │ ├── method.expect.txt │ │ │ ├── method.txt │ │ │ ├── number-literals.expect.txt │ │ │ ├── number-literals.txt │ │ │ ├── objects.expect.txt │ │ │ ├── objects.txt │ │ │ ├── prime.expect.txt │ │ │ ├── prime.txt │ │ │ ├── triple-quote.expect.txt │ │ │ └── triple-quote.txt │ │ ├── powershell/ │ │ │ ├── apos-herestring.expect.txt │ │ │ ├── apos-herestring.txt │ │ │ ├── classes.expect.txt │ │ │ ├── classes.txt │ │ │ ├── flags.expect.txt │ │ │ ├── flags.txt │ │ │ ├── misc.expect.txt │ │ │ ├── misc.txt │ │ │ ├── quote-herestring.expect.txt │ │ │ └── quote-herestring.txt │ │ ├── processing/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── profile/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── prolog/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── properties/ │ │ │ ├── syntax.expect.txt │ │ │ └── syntax.txt │ │ ├── protobuf/ │ │ │ ├── message-message.expect.txt │ │ │ ├── message-message.txt │ │ │ ├── rpc.expect.txt │ │ │ └── rpc.txt │ │ ├── puppet/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── purebasic/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── python/ │ │ │ ├── class_self.expect.txt │ │ │ ├── class_self.txt │ │ │ ├── decorators.expect.txt │ │ │ ├── decorators.txt │ │ │ ├── diacritic_identifiers.expect.txt │ │ │ ├── diacritic_identifiers.txt │ │ │ ├── escaped-quotes.expect.txt │ │ │ ├── escaped-quotes.txt │ │ │ ├── f-strings.expect.txt │ │ │ ├── f-strings.txt │ │ │ ├── false_positives.expect.txt │ │ │ ├── false_positives.txt │ │ │ ├── function-header-comments.expect.txt │ │ │ ├── function-header-comments.txt │ │ │ ├── function-header.expect.txt │ │ │ ├── function-header.txt │ │ │ ├── identifiers.expect.txt │ │ │ ├── identifiers.txt │ │ │ ├── keywords.expect.txt │ │ │ ├── keywords.txt │ │ │ ├── matrix-multiplication.expect.txt │ │ │ ├── matrix-multiplication.txt │ │ │ ├── numbers.expect.txt │ │ │ └── numbers.txt │ │ ├── python-repl/ │ │ │ ├── sample.expect.txt │ │ │ └── sample.txt │ │ ├── q/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── qml/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── r/ │ │ │ ├── names.expect.txt │ │ │ ├── names.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── ops.expect.r │ │ │ ├── ops.r │ │ │ ├── roxygen.expect.txt │ │ │ ├── roxygen.txt │ │ │ ├── strings.expect.txt │ │ │ └── strings.txt │ │ ├── reasonml/ │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── literals.expect.txt │ │ │ ├── literals.txt │ │ │ ├── modules.expect.txt │ │ │ ├── modules.txt │ │ │ ├── pattern-matching.expect.txt │ │ │ ├── pattern-matching.txt │ │ │ ├── types.expect.txt │ │ │ └── types.txt │ │ ├── rib/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── roboconf/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── routeros/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── rsl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── ruby/ │ │ │ ├── blocks.expect.txt │ │ │ ├── blocks.txt │ │ │ ├── gemfile.expect.txt │ │ │ ├── gemfile.txt │ │ │ ├── heredoc.expect.txt │ │ │ ├── heredoc.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── prompt.expect.txt │ │ │ ├── prompt.txt │ │ │ ├── regexes.expect.txt │ │ │ ├── regexes.txt │ │ │ ├── strings.expect.txt │ │ │ └── strings.txt │ │ ├── ruleslanguage/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── rust/ │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── invoked-keywords.expect.txt │ │ │ ├── invoked-keywords.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── sample1.expect.txt │ │ │ ├── sample1.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── traits.expect.txt │ │ │ ├── traits.txt │ │ │ ├── types.expect.txt │ │ │ ├── types.txt │ │ │ ├── variables.expect.txt │ │ │ └── variables.txt │ │ ├── sas/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── scala/ │ │ │ ├── case-classes.expect.txt │ │ │ ├── case-classes.txt │ │ │ ├── end.expect.txt │ │ │ ├── end.txt │ │ │ ├── enum.expect.txt │ │ │ ├── enum.txt │ │ │ ├── export.expect.txt │ │ │ ├── export.txt │ │ │ ├── extension.expect.txt │ │ │ ├── extension.txt │ │ │ ├── for-do.expect.txt │ │ │ ├── for-do.txt │ │ │ ├── given.expect.txt │ │ │ ├── given.txt │ │ │ ├── if-then-else.expect.txt │ │ │ ├── if-then-else.txt │ │ │ ├── inline.expect.txt │ │ │ ├── inline.txt │ │ │ ├── quoted-code.expect.txt │ │ │ ├── quoted-code.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── symbol.expect.txt │ │ │ ├── symbol.txt │ │ │ ├── transparent.expect.txt │ │ │ ├── transparent.txt │ │ │ ├── using-directives.expect.txt │ │ │ ├── using-directives.txt │ │ │ ├── using.expect.txt │ │ │ ├── using.txt │ │ │ ├── while-do.expect.txt │ │ │ └── while-do.txt │ │ ├── scheme/ │ │ │ ├── lambda.expect.txt │ │ │ ├── lambda.txt │ │ │ ├── quoted.expect.txt │ │ │ └── quoted.txt │ │ ├── scilab/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── scss/ │ │ │ ├── css_consistency.expect.txt │ │ │ ├── css_consistency.txt │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── shell/ │ │ │ ├── command-continuation.expect.txt │ │ │ ├── command-continuation.txt │ │ │ ├── plain-prompt.expect.txt │ │ │ ├── plain-prompt.txt │ │ │ ├── prompt-with-slash.expect.txt │ │ │ ├── prompt-with-slash.txt │ │ │ ├── prompt-with-tilde.expect.txt │ │ │ ├── prompt-with-tilde.txt │ │ │ ├── simple.expect.txt │ │ │ ├── simple.txt │ │ │ ├── single.expect.txt │ │ │ └── single.txt │ │ ├── smali/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── smalltalk/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── sml/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── sqf/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── sql/ │ │ │ ├── combos.expect.txt │ │ │ ├── combos.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── join.expect.txt │ │ │ ├── join.txt │ │ │ ├── keywords.expect.txt │ │ │ ├── keywords.txt │ │ │ ├── numeric-types.expect.txt │ │ │ ├── numeric-types.txt │ │ │ ├── set-operator.expect.txt │ │ │ ├── set-operator.txt │ │ │ ├── string-types.expect.txt │ │ │ ├── string-types.txt │ │ │ ├── types.expect.txt │ │ │ ├── types.txt │ │ │ ├── values-statement.expect.txt │ │ │ └── values-statement.txt │ │ ├── stan/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── stata/ │ │ │ ├── built_ins.expect.txt │ │ │ └── built_ins.txt │ │ ├── step21/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── stylus/ │ │ │ ├── css_consistency.expect.txt │ │ │ ├── css_consistency.txt │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── subunit/ │ │ │ ├── subunit-errorline.expect.txt │ │ │ ├── subunit-errorline.txt │ │ │ ├── subunit-failureline.expect.txt │ │ │ ├── subunit-failureline.txt │ │ │ ├── subunit-progressline.expect.txt │ │ │ ├── subunit-progressline.txt │ │ │ ├── subunit-skipline.expect.txt │ │ │ ├── subunit-skipline.txt │ │ │ ├── subunit-successline.expect.txt │ │ │ ├── subunit-successline.txt │ │ │ ├── subunit-tagline.expect.txt │ │ │ ├── subunit-tagline.txt │ │ │ ├── subunit-testline.expect.txt │ │ │ ├── subunit-testline.txt │ │ │ ├── subunit-timeline.expect.txt │ │ │ ├── subunit-timeline.txt │ │ │ ├── subunit-uxsuccessline.expect.txt │ │ │ ├── subunit-uxsuccessline.txt │ │ │ ├── subunit-xfailline.expect.txt │ │ │ └── subunit-xfailline.txt │ │ ├── swift/ │ │ │ ├── attributes.expect.txt │ │ │ ├── attributes.txt │ │ │ ├── availability.expect.txt │ │ │ ├── availability.txt │ │ │ ├── class-func-var.expect.txt │ │ │ ├── class-func-var.txt │ │ │ ├── distributed-actor-runtime.expect.txt │ │ │ ├── distributed-actor-runtime.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── identifiers.expect.txt │ │ │ ├── identifiers.txt │ │ │ ├── keywords.expect.txt │ │ │ ├── keywords.txt │ │ │ ├── macro.expect.txt │ │ │ ├── macro.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── operator-declarations.expect.txt │ │ │ ├── operator-declarations.txt │ │ │ ├── operators.expect.txt │ │ │ ├── operators.txt │ │ │ ├── ownership.expect.txt │ │ │ ├── ownership.txt │ │ │ ├── parameterpack.expect.txt │ │ │ ├── parameterpack.txt │ │ │ ├── precedencegroup.expect.txt │ │ │ ├── precedencegroup.txt │ │ │ ├── regex.expect.txt │ │ │ ├── regex.txt │ │ │ ├── strings.expect.txt │ │ │ ├── strings.txt │ │ │ ├── swiftui.expect.txt │ │ │ ├── swiftui.txt │ │ │ ├── tuples.expect.txt │ │ │ ├── tuples.txt │ │ │ ├── type-definition.expect.txt │ │ │ ├── type-definition.txt │ │ │ ├── types.expect.txt │ │ │ └── types.txt │ │ ├── taggerscript/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── noop.expect.txt │ │ │ └── noop.txt │ │ ├── tap/ │ │ │ ├── basic.expect.txt │ │ │ ├── basic.txt │ │ │ ├── without-numbers.expect.txt │ │ │ ├── without-numbers.txt │ │ │ ├── yaml-block.expect.txt │ │ │ └── yaml-block.txt │ │ ├── tcl/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── variables.expect.txt │ │ │ └── variables.txt │ │ ├── thrift/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── tp/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── twig/ │ │ │ ├── filter_with_underscore.expect.txt │ │ │ ├── filter_with_underscore.txt │ │ │ ├── template_tags.expect.txt │ │ │ └── template_tags.txt │ │ ├── typescript/ │ │ │ ├── class.expect.txt │ │ │ ├── class.txt │ │ │ ├── declares.expect.txt │ │ │ ├── declares.txt │ │ │ ├── decorator-factories.expect.txt │ │ │ ├── decorator-factories.txt │ │ │ ├── functions.expect.txt │ │ │ ├── functions.txt │ │ │ ├── generics.expect.txt │ │ │ ├── generics.txt │ │ │ ├── identifiers_that_include_keywords.expect.txt │ │ │ ├── identifiers_that_include_keywords.txt │ │ │ ├── inline-languages.expect.txt │ │ │ ├── inline-languages.txt │ │ │ ├── jsx.expect.txt │ │ │ ├── jsx.txt │ │ │ ├── module-id.expect.txt │ │ │ ├── module-id.txt │ │ │ ├── namespace_as_identifier.expect.txt │ │ │ ├── namespace_as_identifier.txt │ │ │ ├── nested-templates.expect.txt │ │ │ ├── nested-templates.txt │ │ │ ├── numbers-and-dashes.expect.txt │ │ │ ├── numbers-and-dashes.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── satisfies-and-as.expect.txt │ │ │ └── satisfies-and-as.txt │ │ ├── vala/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── vbnet/ │ │ │ ├── comments.expect.txt │ │ │ ├── comments.txt │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── directives.expect.txt │ │ │ ├── directives.txt │ │ │ ├── literals.expect.txt │ │ │ ├── literals.txt │ │ │ ├── numbers.expect.txt │ │ │ └── numbers.txt │ │ ├── vbscript/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── vbscript-html/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── verilog/ │ │ │ ├── directives.expect.txt │ │ │ ├── directives.txt │ │ │ ├── misc.expect.txt │ │ │ ├── misc.txt │ │ │ ├── numbers.expect.txt │ │ │ └── numbers.txt │ │ ├── vhdl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── vim/ │ │ │ ├── default.expect.txt │ │ │ ├── default.txt │ │ │ ├── strings-comments.expect.txt │ │ │ └── strings-comments.txt │ │ ├── wasm/ │ │ │ ├── sample.expect.txt │ │ │ └── sample.txt │ │ ├── wren/ │ │ │ ├── attributes.expect.txt │ │ │ ├── attributes.txt │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── x86asm/ │ │ │ ├── labels-directives.expect.txt │ │ │ └── labels-directives.txt │ │ ├── xl/ │ │ │ ├── default.expect.txt │ │ │ └── default.txt │ │ ├── xml/ │ │ │ ├── document-type-variations.expect.txt │ │ │ ├── document-type-variations.txt │ │ │ ├── namespace.expect.txt │ │ │ ├── namespace.txt │ │ │ ├── non-ascii-attribute-names.expect.txt │ │ │ ├── non-ascii-attribute-names.txt │ │ │ ├── non-ascii-element-names.expect.txt │ │ │ ├── non-ascii-element-names.txt │ │ │ ├── processing.expect.txt │ │ │ ├── processing.txt │ │ │ ├── space-attributes.expect.txt │ │ │ ├── space-attributes.txt │ │ │ ├── sublanguage_no_relevancy.expect.txt │ │ │ ├── sublanguage_no_relevancy.txt │ │ │ ├── unquoted-attributes.expect.txt │ │ │ └── unquoted-attributes.txt │ │ ├── xquery/ │ │ │ ├── computed_inbuilt.expect.txt │ │ │ ├── computed_inbuilt.txt │ │ │ ├── direct_method.expect.txt │ │ │ ├── direct_method.txt │ │ │ ├── function_body.expect.txt │ │ │ ├── function_body.txt │ │ │ ├── prolog_declarations.expect.txt │ │ │ └── prolog_declarations.txt │ │ ├── yaml/ │ │ │ ├── block.expect.txt │ │ │ ├── block.txt │ │ │ ├── inline.expect.txt │ │ │ ├── inline.txt │ │ │ ├── keys.expect.txt │ │ │ ├── keys.txt │ │ │ ├── numbers.expect.txt │ │ │ ├── numbers.txt │ │ │ ├── special_chars.expect.txt │ │ │ ├── special_chars.txt │ │ │ ├── string.expect.txt │ │ │ ├── string.txt │ │ │ ├── tag.expect.txt │ │ │ └── tag.txt │ │ └── zephir/ │ │ ├── default.expect.txt │ │ └── default.txt │ ├── mocha.opts │ ├── parser/ │ │ ├── beginEndScope.js │ │ ├── compiler-extensions.js │ │ ├── index.js │ │ ├── look-ahead-end-matchers.js │ │ ├── max_keyword_hits.js │ │ ├── resume-scan.js │ │ ├── reuse-endsWithParent.js │ │ └── should-not-destroyData.js │ ├── regex/ │ │ ├── index.js │ │ └── lib/ │ │ ├── analysis.js │ │ └── util.js │ ├── special/ │ │ ├── buildClassName.js │ │ ├── endsWithParentVariants.js │ │ ├── explicitLanguage.js │ │ ├── index.js │ │ ├── languageAlias.js │ │ ├── noHighlight.js │ │ └── subLanguages.js │ └── utility.js ├── tools/ │ ├── build.js │ ├── buildSizeReport.js │ ├── build_browser.js │ ├── build_cdn.js │ ├── build_config.js │ ├── build_node.js │ ├── checkAutoDetect.js │ ├── checkTheme.js │ ├── css │ ├── developer.html │ ├── lib/ │ │ ├── bundling.js │ │ ├── dependencies.js │ │ ├── external_language.js │ │ ├── language.js │ │ └── makestuff.js │ ├── perf.js │ ├── sample_files/ │ │ └── python.txt │ └── templates/ │ └── DIGESTS.md ├── tsconfig.json └── types/ └── index.d.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ .DS_Store build docs/_build __pycache__ *.swp node_modules .project # editors .idea/ .vscode/ .Rproj.user # misc /work ================================================ FILE: .editorconfig ================================================ [*] end_of_line = lf insert_final_newline = true [*.{js,css}] charset = utf-8 indent_style = space indent_size = 2 ================================================ FILE: .eslintrc.js ================================================ module.exports = { env: { browser: true, es6: true, node: true }, extends: [ "eslint:recommended", "standard" ], parserOptions: { ecmaVersion: 2015, sourceType: "module" }, plugins: [ "@typescript-eslint" ], rules: { "no-var": "warn", "init-declarations": ["error", "always"], "array-callback-return": "error", "block-scoped-var": "error", "no-multiple-empty-lines": ["error", { max: 2 }], // we like our semi-colons semi: ["error", "always"], // our codebase doesn't do this at all, so disabled for now "space-before-function-paren": ["error", "never"], // for now ignore diff between types of quoting quotes: "off", // this is the style we are already using "operator-linebreak": ["error", "before", { overrides: { "=": "after" } }], // sometimes we declare variables with extra spacing indent: ["error", 2, { VariableDeclarator: 2 }], // seems like a good idea not to use explicit undefined "no-undefined": "error", // ensure import specifier contains file extension "import/extensions": ["error", "always"] }, overrides: [ { files: ["types/*.ts", "src/*.ts"], parser: '@typescript-eslint/parser', rules: { "import/no-duplicates": "off", "import/extensions": "off" } }, { files: ["src/**/*.js"], rules: { // make sure there is no Node.js specific API slipping into the source files "import/no-nodejs-modules": "error", "import/no-commonjs": "error" } }, { files: ["src/languages/*.js"], rules: { "no-unused-expressions": "off", // languages are all over the map and we don't want to // do a mass edit so turn off the most egregious rule violations // indent: "off", camelcase: "off", "no-control-regex": "off", "no-useless-escape": "off", "comma-dangle": "off", "array-bracket-spacing": ["error", "always" // { // objectsInArrays: true // } ], // "object-curly-spacing": "warn", // "key-spacing": "off", // "array-bracket-spacing": ["warn"], "array-bracket-newline": ["warn", { multiline: true, minItems: 2 }], "array-element-newline": "warn", "object-curly-newline": [1, { minProperties: 2 }], "object-property-newline": [2, { allowAllPropertiesOnSameLine: false } ] } }, { files: ["demo/**/*.js"], globals: { hljs: "readonly" } }, { files: ["test/**/*.js"], globals: { should: "readonly" }, env: { mocha: true }, parserOptions: { ecmaVersion: 2018 } }, { files: ["tools/**/*.js"], parserOptions: { ecmaVersion: 2020 }, rules: { camelcase: "off" } } ] }; ================================================ FILE: .eslintrc.lang.js ================================================ module.exports = { env: { browser: true, es6: true, node: true }, parserOptions: { ecmaVersion: 2015, sourceType: "module" }, // no rules, this file exists only to lint the grammars and check // that no ES2018 or newer syntax has crept in by accident rules: {} }; ================================================ FILE: .git-blame-ignore-revs ================================================ # eslint --fix src/languages d64f68e8aabc67820eec2459bff9a7a0fcc06b95 ================================================ FILE: .gitattributes ================================================ # The build script and some tests use `\n` as markers, so we need to make sure # that all javascript files are checked out using UNIX line endings (not `\r\n`) *.js eol=lf *.txt eol=lf ================================================ FILE: .github/ISSUE_TEMPLATE/1_incorrect-syntax-highlighting.md ================================================ --- name: Report code that we highlight wrong about: You have a specific snippet of code that is not highlighted correctly. title: "(language name) Short description of issue..." labels: bug, help welcome, language assignees: '' --- **Describe the issue** **Which language seems to have the issue?** **Are you using `highlight` or `highlightAuto`?** ... **Sample Code to Reproduce** **Expected behavior** **Additional context** ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Report some other bug about: You are seeing other incorrect, unexpected or unexplained behavior. title: "" labels: bug, help welcome, parser assignees: '' --- **Describe the issue/behavior that seems buggy** **Sample Code or Instructions to Reproduce** **Expected behavior** **Additional context** ================================================ FILE: .github/ISSUE_TEMPLATE/config.yml ================================================ blank_issues_enabled: false contact_links: - name: Join our friendly Discord community url: https://discord.gg/M24EbU7ja9 about: If you'd like to hang out, help out, or need some help - we're here. - name: Read our documentation url: https://highlightjs.readthedocs.io/ about: Sometimes the answers are right there, just waiting to be discovered. - name: Request a new language url: https://highlightjs.readthedocs.io/en/latest/language-requests.html about: Please read our policy on requesting new languages. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Request a new feature (other than a new language) about: You'd like to suggest a potentially helpful new feature... for requesting languages look below. title: "[Request] Short description of the new feature..." labels: enhancement, parser assignees: '' --- **Is your request related to a specific problem you're having?** A clear and concise description of the problem itself. Ex. I'm always frustrated when [...] **The solution you'd prefer / feature you'd like to see added...** A clear and concise description of how you imagine we might solve this (if you have any ideas). **Any alternative solutions you considered...** A clear and concise description of any alternative solutions or features you may have considered. **Additional context...** Add any other context or screenshots relating to the feature request here. ================================================ FILE: .github/ISSUE_TEMPLATE/z_request_language_repo.md ================================================ --- name: Request a new 3rd party grammar repository about: You'd like to host your repo inside the highlightjs org title: "(request org repo) highlightjs-[name of your grammar]" labels: language assignees: 'joshgoebel' --- I would like to request the creation of a `highlightjs-[my-grammar]` repository for my 3rd party grammar. - [ ] I have an existing personal repository ready to go ### Metadata - Grammar Name: _Language Name_ - Link to repo: _link to existing repository_ ### Requirements - [ ] I've read the [language Contributor Checklist](https://highlightjs.readthedocs.io/en/latest/language-contribution.html) - [ ] I've read the [Language Contribution Guide](https://github.com/highlightjs/highlight.js/blob/main/extra/3RD_PARTY_QUICK_START.md) - [ ] I'm currently willing to support and maintain this grammar over time - [ ] That repo includes a `dist` folder with CDN-ready `CJS` and `ESM` builds - [ ] That `README.md` includes examples of simple web usage - [ ] That `README.md` includes examples of Node.js usage ### Afterwards Submit a PR that: - [ ] adds mention of your new language to `CHANGES.md` - [ ] updates `SUPPORTED_LANGUAGES.md` in the main library ================================================ FILE: .github/dependabot.yml ================================================ version: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly" ================================================ FILE: .github/pull_request_template.md ================================================ ### Changes ### Checklist - [ ] Added markup tests, or they don't apply here because... - [ ] Updated the changelog at `CHANGES.md` ================================================ FILE: .github/workflows/lint.yml ================================================ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Lint on: pull_request: branches: - main permissions: contents: read jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "*" # latest - run: npm ci - run: npm run lint - run: npm run lint-languages ================================================ FILE: .github/workflows/release.yml ================================================ name: Release on: push: tags: - "*alpha*" - "*pre*" - "*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: - name: Checkout highlight.js uses: actions/checkout@v4 - name: Tag is ${{ github.ref }}. # we have to repeat ourselves here since the environment is not actually updated # until the next step executes, so we can't access $TAG_NAME yet run: | echo "TAG_NAME=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV echo "MAJOR_VERSION=$(echo ${GITHUB_REF/refs\/tags\//} | cut -d'.' -f1)" >> $GITHUB_ENV - name: Make sure we are pushing a tag... if: ${{ !contains(github.ref,'refs/tags/') }} run: false # run: echo "TAG_NAME=0.0.0-test0" >> $GITHUB_ENV - if: contains(github.ref, 'beta') || contains(github.ref, 'pre') || contains(github.ref, 'alpha') run: | echo "NPM_TAG=beta" >> $GITHUB_ENV echo "RELEASING=beta" >> $GITHUB_ENV - if: ${{ !(contains(github.ref, 'beta') || contains(github.ref, 'pre') || contains(github.ref, 'alpha')) }} run: | echo "NPM_TAG=latest" >> $GITHUB_ENV echo "RELEASING=stable" >> $GITHUB_ENV - name: match-tag-to-package-version uses: geritol/match-tag-to-package-version@0.2.0 env: TAG_PREFIX: refs/tags/ # Optional, default prefix refs/tags/ - name: Use Node.js 20.x uses: actions/setup-node@v4 with: node-version: 20.x - name: Build Node.js package run: | npm install node ./tools/build.js -t node npm test - name: Publish highlight.js to NPM id: publish uses: JS-DevTools/npm-publish@v3 with: check-version: true token: ${{ secrets.NPM_TOKEN }} package: ./build/package.json tag: ${{ env.NPM_TAG }} - if: steps.publish.outputs.type != 'none' run: | echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}" # if stable release - name: Stable Release if: env.RELEASING == 'stable' run: echo "BRANCH_NAME=${MAJOR_VERSION}-stable" >> $GITHUB_ENV # else (beta) - name: Beta Release if: env.RELEASING == 'beta' run: echo "BRANCH_NAME=main" >> $GITHUB_ENV - name: Confirm release is either stable or beta if: ${{ !(env.RELEASING == 'stable' || env.RELEASING == 'beta') }} run: | echo We seem to be releasing `${RELEASING}`. false - name: Checkout cdn-release uses: actions/checkout@v4 with: repository: 'highlightjs/cdn-release' path: 'cdn-release' token: ${{ secrets.CDN_REPO_TOKEN }} ref: ${{ env.BRANCH_NAME }} - name: Build CDN package run: node ./tools/build.js -t cdn :common - name: Commmit & Push cdn-release ${{ env.TAG_NAME }} working-directory: ./cdn-release run: | rm -r ./build mv ../build/ ./build/ mv ./build/DIGESTS.md . git config user.name github-actions git config user.email github-actions@github.com git add ./build/ git add ./DIGESTS.md git commit -m'Update to version ${{ env.TAG_NAME }}' git tag ${TAG_NAME} git push -f --atomic origin ${BRANCH_NAME} ${TAG_NAME} - name: Publish cdn-assets to NPM id: publish_cdn uses: JS-DevTools/npm-publish@v3 with: check-version: true token: ${{ secrets.NPM_TOKEN }} package: ./cdn-release/build/package.json tag: ${{ env.NPM_TAG }} # log.info('Updating CDN repo at %s' % settings.HLJS_CDN_SOURCE) # run(['nodejs', 'tools/build.js', '--target', 'cdn', ':common']) # os.chdir(settings.HLJS_CDN_SOURCE) # run(['git', 'pull', '-f']) # lines = run(['git', '--git-dir', os.path.join(settings.HLJS_CDN_SOURCE, '.git'), 'tag']) # build_dir = os.path.join(settings.HLJS_CDN_SOURCE, 'build') # if version in lines: # log.info('Tag %s already exists in the local CDN repo' % version) # else: # if os.path.exists(build_dir): # shutil.rmtree(build_dir) # shutil.move(os.path.join(settings.HLJS_SOURCE, 'build'), build_dir) # run(['git', 'add', '.']) # run(['git', 'commit', '-m', 'Update to version %s' % version]) # run(['git', 'tag', version]) # run(['git', 'push']) # run(['git', 'push', '--tags']) # npm_publish(build_dir) # os.chdir(settings.HLJS_SOURCE) ================================================ FILE: .github/workflows/size_report_comment.yml ================================================ name: Comment Build Size Report on: workflow_run: workflows: ["Create Build Size Report"] types: - completed jobs: comment_report: runs-on: ubuntu-latest if: > github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: - name: "Download size report artifact" uses: actions/github-script@v7 with: script: | var artifacts = await github.rest.actions.listWorkflowRunArtifacts({ owner: context.repo.owner, repo: context.repo.repo, run_id: ${{github.event.workflow_run.id }}, }); var matchArtifact = artifacts.data.artifacts.filter((artifact) => { return artifact.name == "size_report" })[0]; var download = await github.rest.actions.downloadArtifact({ owner: context.repo.owner, repo: context.repo.repo, artifact_id: matchArtifact.id, archive_format: 'zip', }); var fs = require('fs'); fs.writeFileSync('${{github.workspace}}/size_report.zip', Buffer.from(download.data)); - run: unzip -d size_report size_report.zip - name: "Comment on PR" uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | var fs = require('fs'); var issue_number = Number(fs.readFileSync('./size_report/pull_req_nr')); var size_report = String(fs.readFileSync('./size_report/report.md')); await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issue_number, body: size_report }); ================================================ FILE: .github/workflows/size_report_create.yml ================================================ name: Create Build Size Report on: pull_request: jobs: run: runs-on: ubuntu-latest steps: - name: Checkout Base uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.base.ref }} path: base - name: Checkout PR uses: actions/checkout@v4 with: path: pr - name: Build CDN (Base) run: | npm ci npm run build-cdn working-directory: ./base - name: Build CDN (PR) run: | npm ci npm run build-cdn working-directory: ./pr - name: Create Size Report run: | mkdir size_report echo ${{ github.event.number }} > size_report/pull_req_nr REPORT=$(./pr/tools/buildSizeReport.js ./base/build ./pr/build) echo "$REPORT" > size_report/report.md - name: Save Size Report as Artifact uses: actions/upload-artifact@v4 with: name: size_report path: ./size_report ================================================ FILE: .gitignore ================================================ .DS_Store build docs/_build __pycache__ *.swp node_modules .project yarn.lock extra/ # play stuff quick* test*.* extra* # editors .idea/ .nova/ .vscode/ .Rproj.user # misc /work /website ================================================ FILE: .mocharc.json ================================================ { "require": "should" } ================================================ FILE: .readthedocs.yaml ================================================ # .readthedocs.yaml # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details # Required version: 2 # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/conf.py # Optionally build your docs in additional formats such as PDF # formats: # - pdf # Optionally set the version of Python and requirements required to build your docs python: version: 3.7 install: - requirements: docs/requirements.txt ================================================ FILE: .tokeignore ================================================ test/* src/styles/* *.md *.json tools docs types ================================================ FILE: CHANGES.md ================================================ ## Version 11.11.2 Themes: - added "vs Dark " theme [Twineee1][] New Grammars: - added 3rd party Aiken grammar to SUPPORTED_LANGUAGES [Josh Marchand][] - added 3rd party VoltScript grammar to SUPPORTED_LANGUAGES [Chester Moses][] - added 3rd party Prisma grammar to SUPPORTED_LANGUAGES [SungHyun Kim][] - added 3rd party Magik grammar to SUPPORTED_LANGUAGES [Sebastiaan Speck][] - added 3rd party Gleam grammar to SUPPORTED_LANGUAGES [Filip Hoffmann][] - added 3rd party L4 grammar to SUPPORTED_LANGUAGES [Thomas Gorissen][] - added 3rd party Bicep grammar to SUPPORTED_LANGUAGES [Anthony Martin][] - added 3rd party Abc Notation grammar to SUPPORTED_LANGUAGES [NriotHrreion][] Core Grammars: - fix(javascript) correctly highlight 'for await' again [wolfgang42][] - enh(csp) add missing directives / keywords from MDN (7 more) [Max Liashuk][] - enh(ada) add new `parallel` keyword, allow `[]` for Ada 2022 [Max Reznik][] - fix(ex) adds support for `?'` char literal and missing `defguardp` keyword [Kevin Bloch][] - fix(diff) fix unified diff hunk header regex to allow unpaired numbers [Chris Wilson][] - enh(php) support single line and hash comments in attributes, constructor and functions [Antoine Musso][] - enh(json) add json5 support [Kerry Shetline][] - fix(css) `unicode-range` parsing, issue #4253 [Kerry Shetline][] - fix(csharp) Support digit separators [te-ing][] Documentation: - alphabetized languages + upper-cased BASIC in SUPPORTED_LANGUAGES.md [Adam Lui][] Themes: - Fix: cybertopia themes render correctly in shadow DOM [hbgl][] CONTRIBUTORS [Josh Marchand]: https://github.com/yHSJ [Max Liashuk]: https://github.com/probil [Max Reznik]: https://github.com/reznikmm [Kevin Bloch]: https://github.com/codingthat [Chris Wilson]: https://github.com/sushicw [Antoine Musso]: https://github.com/hashar [Chester Moses]: https://github.com/Chester-Moses-HCL [Kerry Shetline]: https://github.com/kshetline [SungHyun Kim]: https://github.com/witch-factory [Adam Lui]: https://github.com/adamlui [Sebastiaan Speck]: https://github.com/sebastiaanspeck [Filip Hoffmann]: https://github.com/folospior [Twineee1]: https://github.com/Twineee1 [hbgl]: https://github.com/hbgl [Thomas Gorissen]: https://github.com/serrynaimo [te-ing]: https://github.com/te-ing [Anthony Martin]: https://github.com/anthony-c-martin [NriotHrreion]: https://github.com/NriotHrreion ## Version 11.11.1 - Fixes regression with Rust grammar. ## Version 11.11.0 CAVEATS / POTENTIALLY BREAKING CHANGES - Nothing yet. Core Grammars: - fix(rust) - adds emoji support in single quote strings [joshgoebel][] - fix(apache) - support line continuation via `\` [Josh Goebel][] - fix(makefile) - allow strings inside `$()` expressions [aneesh98][] - enh(arcade) updated to ArcGIS Arcade version 1.29 [Kristian Ekenes][] - enh(css) add all properties listed on MDN (96 additions including `anchor-name`, `aspect-ratio`, `backdrop-filter`, `container`, `margin-trim`, `place-content`, `scroll-timeline`, ...) [BaliBalo][] - enh(excel) add built-in functions for Excel 365 release to 2024 [Danny Winrow][] - enh(erlang) OTP 27 triple-quoted strings [nixxquality][] - enh(erlang) OTP 27 doc attribute [nixxquality][] - enh(erlang) OTP 27 Sigil type [nixxquality][] - enh(erlang) OTP25/27 maybe statement [nixxquality][] - enh(dart) Support digit-separators in number literals [Sam Rawlins][] - enh(csharp) add Contextual keywords `file`, `args`, `dynamic`, `record`, `required` and `scoped` [Alvin Joy][] - enh(lua) add 'pluto' as an alias [Sainan] - enh(bash) add reserved keywords `time` and `coproc` [Álvaro Mondéjar][] - enh(nix) update keywords [h7x4][] - enh(nix) support paths [h7x4][] - enh(nix) support lookup paths [h7x4][] - enh(nix) support operators [h7x4][] - enh(nix) support REPL keywords [h7x4][] - enh(nix) support markdown comments [h7x4][] - enh(nix) support basic function params [h7x4][] - enh(nix) better parsing of attrsets [h7x4][] - fix(c) - Fixed hex numbers with decimals [Dxuian] - fix(typescript) - Fixedoptional property not highlighted correctly [Dxuian] - fix(ruby) - fix `|=` operator false positives (as block arguments) [Aboobacker MK] - enh(gcode) rewrote language for modern gcode support [Barthélémy Bonhomme][] - fix(sql) - Fixed sql primary key and foreign key spacing issue [Dxuian] - fix(cpp) added flat_set and flat_map as a part of cpp 23 version [Lavan] - fix(yaml) - Fixed special chars in yaml [Dxuian] - fix(basic) - Fixed closing quotation marks not required for a PRINT statement [Somya] - fix(nix) remove `add` builtin [h7x4][] - fix(nix) mark `or` as builtin instead of literal [h7x4][] - fix(nix) handle `'''` string escapes [h7x4][] - fix(nix) handle backslash string escapes [h7x4][] - fix(nix) don't mix escapes for `"` and `''` strings [h7x4][] - fix(swift) - Fixed syntax highlighting for class func/var declarations [guuido] - fix(yaml) - Fixed wrong escaping behavior in single quoted strings [guuido] - enh(nim) - Add `concept` and `defer` to list of Nim keywords [Jake Leahy] - fix(cpp) - Exclude keywords from highlighting as function calls [Eisenwave] New Grammars: - added 3rd party TTCN-3 grammar to SUPPORTED_LANGUAGES [Osmocom][] - added 3rd party Odin grammar to SUPPORTED_LANGUAGES [clsource][] - added 3rd party Liquid grammar to SUPPORTED_LANGUAGES [Laurel King][] Developer Tools: - Nothing yet. Themes: - Added `Rosé Pine` theme [William Wilkinson][] - Added `Cybertopia Cherry` theme [Alexandre ZANNI][] - Added `Cybertopia Dimmer` theme [Alexandre ZANNI][] - Added `Cybertopia Icecap` theme [Alexandre ZANNI][] - Added `Cybertopia Saturated` theme [Alexandre ZANNI][] Improvements: - Resolve the memory leak problem when creating multiple Highlight.js instances [Imken][] CONTRIBUTORS [Josh Goebel]: https://github.com/joshgoebel [aneesh98]: https://github.com/aneesh98 [BaliBalo]: https://github.com/BaliBalo [William Wilkinson]: https://github.com/wilkinson4 [nixxquality]: https://github.com/nixxquality [srawlins]: https://github.com/srawlins [Alvin Joy]: https://github.com/alvinsjoy [Dxuian]:https://github.com/Dxuian [Aboobacker MK]: https://github.com/tachyons [Imken]: https://github.com/immccn123 [Sainan]: https://github.com/Sainan [Osmocom]: https://github.com/osmocom [Álvaro Mondéjar]: https://github.com/mondeja [Alexandre ZANNI]: https://github.com/noraj [Barthélémy Bonhomme]: https://github.com/barthy-koeln [Lavan]: https://github.com/jvlavan [Somya]: https://github.com/somya-05 [guuido]: https://github.com/guuido [clsource]: https://github.com/clsource [Jake Leahy]: https://github.com/ire4ever1190 [Laurel King]: https://github.com/laurelthorburn [Kristian Ekenes]: https://github.com/ekenes [Danny Winrow]: https://github.com/dannywinrow [Eisenwave]: https://github.com/Eisenwave/ ## Version 11.10.0 CAVEATS / POTENTIALLY BREAKING CHANGES - Drops support for Node 16.x, which is no longer supported by Node.js. Core Grammars: - enh(typescript) add support for `satisfies` operator [Kisaragi Hiu][] - enc(c) added more C23 keywords [Melkor-1][] - enh(json) added jsonc as an alias [BackupMiles][] - enh(gml) updated to latest language version (GML v2024.2) [gnysek][] - enh(c) added more C23 keywords and preprcoessor directives [Eisenwave][] - enh(js/ts) support namespaced tagged template strings [Aral Balkan][] - enh(perl) fix false-positive variable match at end of string [Josh Goebel][] - fix(cpp) not all kinds of number literals are highlighted correctly [Lê Duy Quang][] - fix(css) fix overly greedy pseudo class matching [Bradley Mackey][] - enh(arcade) updated to ArcGIS Arcade version 1.24 [Kristian Ekenes][] - fix(typescript): params types [Mohamed Ali][] - fix(rust) fix escaped double quotes in string [Mohamed Ali][] - fix(rust) fix for r# raw identifier not being highlighted correctly. [JaeBaek Lee][] - enh(rust) Adding union to be recognized as a keyword in Rust. [JaeBaek Lee][] - fix(yaml) fix for yaml with keys having brackets highlighted incorrectly [Aneesh Kulkarni][] - fix(csharp) add raw string highlighting for C# 11. [Tara][] - fix(bash) fix # within token being detected as the start of a comment [Felix Uhl][] - fix(python) fix `or` conflicts with string highlighting [Mohamed Ali][] - enh(python) adds a scope to the `self` variable [Lee Falin][] - enh(delphi) allow digits to be omitted for hex and binary literals [Jonah Jeleniewski][] - enh(delphi) add support for digit separators [Jonah Jeleniewski][] - enh(delphi) add support for character strings with non-decimal numerics [Jonah Jeleniewski][] - fix(javascript) incorrect function name highlighting [CY Fung][] - fix(1c) fix escaped symbols "+-;():=,[]" literals [Vitaly Barilko][] - fix(swift) correctly highlight generics and conformances in type definitions [Bradley Mackey][] - enh(swift) add package keyword [Bradley Mackey][] - fix(swift) ensure keyword attributes highlight correctly [Bradley Mackey][] - fix(types) fix interface LanguageDetail > keywords [Patrick Chiu] - enh(java) add `goto` to be recognized as a keyword in Java [Alvin Joy][] - enh(bash) add keyword `sudo` [Alvin Joy][] - fix(haxe) captures `new` keyword without capturing it within variables/class names [Cameron Taylor][] - fix(go) fix go number literals to accept `_` separators, add hex p exponents [Lisa Ugray][] - enh(markdown) add entity support [David Schach][] [TaraLei][] - enh(css) add `justify-items` and `justify-self` attributes [Vasily Polovnyov][] - enh(css) add `accent-color`, `appearance`, `color-scheme`, `rotate`, `scale` and `translate` attributes [Carl Räfting][] - fix(fortran) fixes parsing of keywords delimited by dots [Julien Bloino][] - enh(css) add `select`, `option`, `optgroup`, `picture` and `source` to list of known tags [Vasily Polovnyov][] - enh(css) add `inset`, `inset-*`, `border-start-*-radius` and `border-end-*-radius` attributes [Vasily Polovnyov][] - enh(css) add `text-decoration-skip-ink`, `text-decoration-thickness` and `text-underline-offset` attributes [Vasily Polovnyov][] - enh(java) add `when` to be recognized as a keyword in Java [Chiel van de Steeg][] New Grammars: - added 3rd party CODEOWNERS grammar to SUPPORTED_LANGUAGES [nataliia-radina][] - added 3rd party Luau grammar to SUPPORTED_LANGUAGES [Robloxian Demo][] - added 3rd party ReScript grammar to SUPPORTED_LANGUAGES [Paul Tsnobiladzé][] - added 3rd party Zig grammar to SUPPORTED_LANGUAGES [Hyou BunKen][] - added 3rd party WGSL grammar to SUPPORTED_LANGUAGES [Arman Uguray][] - added 3rd party Unison grammar to SUPPORTED_LANGUAGES [Rúnar Bjarnason][] - added 3rd party Phix grammar to SUPPORTED_LANGUAGES [PeteLomax][] - added 3rd party Mirth grammar to SUPPORTED_LANGUAGES [Sierra][] - added 3rd party JSONata grammar to SUPPORTED_LANGUAGES [Vlad Dimov][] Developer Tool: - enh(tools): order CSS options picklist [David Schach][] - enh(tools): remove duplicate CSS options [David Schach][] - (typescript): deprecate old `highlight` API [Misha Kaletsky][] Themes: - Added `1c-light` theme a like in the IDE 1C:Enterprise 8 (for 1c) [Vitaly Barilko][] [Kisaragi Hiu]: https://github.com/kisaragi-hiu [Melkor-1]: https://github.com/Melkor-1 [PeteLomax]: https://github.com/petelomax [gnysek]: https://github.com/gnysek [Eisenwave]: https://github.com/Eisenwave [Aral Balkan]: https://github.com/aral [Lê Duy Quang]: https://github.com/leduyquang753 [Mohamed Ali]: https://github.com/MohamedAli00949 [JaeBaek Lee]: https://github.com/ThinkingVincent [Bradley Mackey]: https://github.com/bradleymackey [Kristian Ekenes]: https://github.com/ekenes [Aneesh Kulkarni]: https://github.com/aneesh98 [Bruno Meneguele]: https://github.com/bmeneg [Tara]: https://github.com/taralei [Felix Uhl]: https://github.com/iFreilicht [nataliia-radina]: https://github.com/Nataliia-Radina [Robloxian Demo]: https://github.com/RobloxianDemo [Paul Tsnobiladzé]: https://github.com/tsnobip [Jonah Jeleniewski]: https://github.com/cirras [Josh Goebel]: https://github.com/joshgoebel [CY Fung]: https://github.com/cyfung1031 [Vitaly Barilko]: https://github.com/Diversus23 [Patrick Chiu]: https://github.com/patrick-kw-chiu [Alvin Joy]: https://github.com/alvinsjoy [Lisa Ugray]: https://github.com/lugray [TaraLei]: https://github.com/TaraLei [Cameron Taylor]: https://github.com/ninjamuffin99 [Vasily Polovnyov]: https://github.com/vast [Arman Uguray]: https://github.com/armansito [Rúnar Bjarnason]: https://github.com/runarorama [Carl Räfting]: https://github.com/carlrafting [BackupMiles]: https://github.com/BackupMiles [Julien Bloino]: https://github.com/jbloino [Sierra]: https://github.com/casuallyblue [Vlad Dimov]: https://github.com/DevDimov [Chiel van de Steeg]: https://github.com/cvdsteeg ## Version 11.9.0 CAVEATS / POTENTIALLY BREAKING CHANGES - Drops support for Node 14.x, which is no longer supported by Node.js. - In the `node` build `styles/*.css` files now ship un-minified with minified counterparts as: `styles/*.min.css` [mvorisek][] (this makes things consistent with our `cdn` builds) Parser: - (enh) prevent re-highlighting of an element [joshgoebel][] - (chore) Remove discontinued badges from README [Bradley Mackey][] - (chore) Fix build size report [Bradley Mackey][] New Grammars: - added 3rd party Iptables grammar to SUPPORTED_LANGUAGES [Checconio][] - added 3rd party x86asmatt grammar to SUPPORTED_LANGUAGES [gondow][] - added 3rd party riscv64 grammar to SUPPORTED_LANGUAGES [aana-h2][] - added 3rd party Ballerina grammar to SUPPORTED_LANGUAGES [Yasith Deelaka][] Core Grammars: - fix(cpp) fixed highlighter break state [Md Saad Akhtar][] - fix(rust) added negative-lookahead for callable keywords `if` `while` `for` [Omar Hussein][] - enh(armasm) added `x0-x30` and `w0-w30` ARMv8 registers [Nicholas Thompson][] - enh(haxe) added `final`, `is`, `macro` keywords and `$` identifiers [Robert Borghese][] - enh(haxe) support numeric separators and suffixes [Robert Borghese][] - fix(haxe) fixed metadata arguments and support non-colon syntax [Robert Borghese][] - fix(haxe) differentiate `abstract` declaration from keyword [Robert Borghese][] - fix(bash) do not delimit a string by an escaped apostrophe [hancar][] - enh(swift) support `macro` keyword [Bradley Mackey][] - enh(swift) support parameter pack keywords [Bradley Mackey][] - enh(swift) regex literal support [Bradley Mackey][] - enh(swift) `@unchecked` and `@Sendable` support [Bradley Mackey][] - enh(scala) add using directives support `//> using foo bar` [Jamie Thompson][] - fix(scala) fixed comments in constructor arguments not being properly highlighted [Isaac Nonato][] - enh(swift) ownership modifiers support [Bradley Mackey][] - enh(nsis) Add `!assert` compiler flag [idleberg][] - fix(haskell) do not treat double dashes inside infix operators as comments [Zlondrej][] - enh(rust) added `eprintln!` macro [qoheniac][] - enh(leaf) update syntax to 4.0 [Samuel Bishop][] - fix(reasonml) simplify syntax and align it with ocaml [jchavarri][] - fix(swift) `warn_unqualified_access` is an attribute [Bradley Mackey][] - enh(swift) macro attributes are highlighted as keywords [Bradley Mackey][] - enh(stan) updated for version 2.33 (#3859) [Brian Ward][] - enh(llvm) match additional types [wtz][] - fix(css) added '_' css variable detection [Md Saad Akhtar][] - enh(groovy) add `record` and `var` as keywords [Guillaume Laforge][] Developer Tool: - (chore) Update dev tool to use the new `highlight` API. [Shah Shabbir Ahmmed][] - (enh) Auto-update the highlighted output when the language dropdown changes. [Shah Shabbir Ahmmed][] [Robert Borghese]: https://github.com/RobertBorghese [Isaac Nonato]: https://github.com/isaacnonato [Shah Shabbir Ahmmed]: https://github.com/shabbir23ah [Josh Goebel]: https://github.com/joshgoebel [Checconio]: https://github.com/Checconio [Bradley Mackey]: https://github.com/bradleymackey [mvorisek]: https://github.com/mvorisek [qoheniac]: https://github.com/qoheniac [Samuel Bishop]: https://github.com/dannflor [gondow]: https://github.com/gondow [jchavarri]: https://github.com/jchavarri [aana-h2]: https://github.com/aana-h2 [Nicholas Thompson]: https://github.com/NAThompson [Yasith Deelaka]: https://github.com/YasithD [Brian Ward]: https://github.com/WardBrian [wtz]: https://github.com/wangtz0607 [Md Saad Akhtar]: https://github.com/akhtarmdsaad [Guillaume Laforge]: https://github.com/glaforge ## Version 11.8.0 Parser engine: - added a function to default export to generate a fresh highlighter instance to be used by extensions [WisamMechano][] - added BETA `__emitTokens` key to grammars to allow then to direct their own parsing, only using Highlight.js for the HTML rendering [Josh Goebel][] - (enh) add `removePlugin` api [faga295][] - (fix) typo in language name of `JavaScript` [Cyrus Kao][] New Grammars: - added 3rd party Lang grammar to SUPPORTED_LANGUAGES [AdamRaichu][] - added 3rd party C3 grammar to SUPPORTED_LANGUAGES [aliaegik][] Core Grammars: - enh(sql) support `_` in variable names [joshgoebel][] - enh(mathematica) update keywords list to 13.2.1 [arnoudbuzing][] - enh(protobuf) add `proto` alias for Protobuf [dimitropoulos][] - enh(sqf) latest changes in Arma 3 v2.11 [Leopard20][] - enh(js/ts) Added support for GraphQL tagged template strings [Ali Ukani][] - enh(javascript) add sessionStorage to list of built-in variables [Jeroen van Vianen][] - enh(http) Add support for HTTP/3 [Rijenkii][] - added 3rd party Motoko grammar to SUPPORTED_LANGUAGES [rvanasa][] - added 3rd party Candid grammar to SUPPORTED_LANGUAGES [rvanasa][] - fix(haskell) Added support for characters [CrystalSplitter][] - enh(dart) Add `base`, `interface`, `sealed`, and `when` keywords [Sam Rawlins][] - enh(php) detect newer more flexible NOWdoc syntax (#3679) [Timur Kamaev][] - enh(python) improve autodetection of code with type hinting any function's return type (making the `->` operator legal) [Keyacom][] - enh(bash) add `select` and `until` as keywords [arnoudbuzing]: https://github.com/arnoudbuzing [aliaegik]: https://github.com/aliaegik [Josh Goebel]: https://github.com/joshgoebel [Timur Kamaev]: https://github.com/doiftrue [Leopard20]: https://github.com/Leopard20/ [WisamMechano]: https://github.com/wisammechano [faga295]: https://github.com/faga295 [AdamRaichu]: https://github.com/AdamRaichu [Ali Ukani]: https://github.com/ali [Jeroen van Vianen]: https://github.com/morinel [gnysek]: https://github.com/gnysek [Rijenkii]: https://github.com/rijenkii [faga295]: https://github.com/faga295 [rvanasa]: https://github.com/rvanasa [CrystalSplitter]: https://github.com/CrystalSplitter [Sam Rawlins]: https://github.com/srawlins [Keyacom]: https://github.com/Keyacom [Boris Verkhovskiy]: https://github.com/verhovsky [Cyrus Kao]: https://github.com/CyrusKao [Zlondrej]: https://github.com/zlondrej ## 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 ` async function title highlights (#3405) [Josh Goebel][] - enh(twig) update keywords list (#3415) [Matthieu Lempereur][] - fix(python) def, class keywords detected mid-identifier (#3381) [Josh Goebel][] - fix(python) Fix recognition of numeric literals followed by keywords without whitespace (#2985) [Richard Gibson][] - enh(swift) add SE-0290 unavailability condition (#3382) [Bradley Mackey][] - fix(fsharp) Highlight operators, match type names only in type annotations, support quoted identifiers, and other smaller fixes. [Melvyn Laïly][] - enh(java) add `sealed` and `non-sealed` keywords (#3386) [Bradley Mackey][] - enh(js/ts) improve `CLASS_REFERENCE` (#3411) [Josh Goebel][] - enh(nsis) Update defines pattern to allow `!` (#3417) [idleberg][] - enh(nsis) Update language strings pattern to allow `!` (#3420) [idleberg][] - fix(stan) Updated for Stan 2.28 and other misc. improvements (#3410) - enh(nsis) Update variables pattern (#3416) [idleberg][] - fix(clojure) Several issues with Clojure highlighting (#3397) [Björn Ebbinghaus][] - fix(clojure) `comment` macro catches more than it should (#3395) - fix(clojure) `$` in symbol breaks highlighting - fix(clojure) Add complete regex for number detection - enh(clojure) Add character mode for character literals - fix(clojure) Inconsistent namespaced map highlighting - enh(clojure) Add `regex` mode to regex literal - fix(clojure) Remove inconsistent/broken highlighting for metadata - enh(clojure) Add `punctuation` mode for commas. - fix(julia) Enable the `jldoctest` alias (#3432) [Fons van der Plas][] Developer Tools: - (chore) add gzip size compression report (#3400) [Bradley Mackey][] Themes: - Modified background color in css for Gradient Light and Gradient Dark themes [Samia Ali][] [John Foster]: https://github.com/jf990 [Pegasis]: https://github.com/PegasisForever [Wojciech Kania]: https://github.com/wkania [Jeylani B]: https://github.com/jeyllani [Richard Gibson]: https://github.com/gibson042 [Bradley Mackey]: https://github.com/bradleymackey [Melvyn Laïly]: https://github.com/mlaily [Björn Ebbinghaus]: https://github.com/MrEbbinghaus [Josh Goebel]: https://github.com/joshgoebel [Samia Ali]: https://github.com/samiaab1990 [Matthieu Lempereur]: https://github.com/MrYamous [idleberg]: https://github.com/idleberg [Fons van der Plas]: https://github.com/fonsp [Felipe Contreras]: https://github.com/felipec ## Version 11.3.1 Build: - (fix) Grammar CDN modules not generated correctly. (#3363) [Josh Goebel][] [Josh Goebel]: https://github.com/joshgoebel ## Version 11.3.0 Build: - add `HighlightJS` named export (#3295) [Josh Goebel][] - add `.default` named export to CJS builds (#3333) [Josh Goebel][] Parser: - add first rough performance testing script (#3280) [Austin Schick][] - add `throwUnescapedHTML` to warn against potential HTML injection [Josh Goebel][] - expose `regex` helper functions via `hljs` injection [Josh Goebel][] - concat - lookahead - either - optional - anyNumberOfTimes Grammars: - fix(ts) some complex types would classify as JSX (#3278) [Josh Goebel][] - fix(js/ts) less false positives for `class X extends Y` (#3278) [Josh Goebel][] - enh(css): add properties from several W3C (Candidate) Recommendations (#3308) - fix(js/ts) `Float32Array` highlighted incorrectly (#3353) [Josh Goebel][] - fix(css) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] - fix(scss) single-colon psuedo-elements no longer break highlighting (#3240) [Josh Goebel][] - enh(fsharp) rewrite most of the grammar, with many improvements [Melvyn Laïly][] - enh(go) better type highlighting, add `error` type [Josh Goebel][] - fix(js/ts) regex inside `SUBST` is no longer highlighted [Josh Goebel][] - fix(python) added support for unicode identifiers (#3280) [Austin Schick][] - enh(css/less/stylus/scss) improve consistency of function dispatch (#3301) [Josh Goebel][] - enh(css/less/stylus/scss) detect block comments more fully (#3301) [Josh Goebel][] - fix(cpp) switch is a keyword (#3312) [Josh Goebel][] - fix(cpp) fix `xor_eq` keyword highlighting. [Denis Kovalchuk][] - enh(c,cpp) highlight type modifiers as type (#3316) [Josh Goebel][] - enh(css/less/stylus/scss) add support for CSS Grid properties [monochromer][] - enh(java) add support for Java Text Block (#3322) [Teletha][] - enh(scala) add missing `do` and `then` keyword (#3323) [Nicolas Stucki][] - enh(scala) add missing `enum`, `export` and `given` keywords (#3328) [Nicolas Stucki][] - enh(scala) remove symbol syntax and fix quoted code syntax (#3324) [Nicolas Stucki][] - enh(scala) add Scala 3 `extension` soft keyword (#3326) [Nicolas Stucki][] - enh(scala) add Scala 3 `end` soft keyword (#3327) [Nicolas Stucki][] - enh(scala) add `inline` soft keyword (#3329) [Nicolas Stucki][] - enh(scala) add `using` soft keyword (#3330) [Nicolas Stucki][] - enh(fsharp) added `f#` alias (#3337) [Bahnschrift][] - enh(bash) added gnu core utilities (#3342) [katzeprior][] - enh(nsis) add new NSIS commands (#3351) [idleberg][] - fix(nsis) set `case_insensitive` to `true` (#3351) [idleberg][] - fix(css/less/stylus/scss) highlight single-colon psuedo-elements properly (#3240) [zsoltlengyelit][] - fix(css) add css hex color alpha support (#3360) [ierehon1905][] [Austin Schick]: https://github.com/austin-schick [Josh Goebel]: https://github.com/joshgoebel [Denis Kovalchuk]: https://github.com/deniskovalchuk [monochromer]: https://github.com/monochromer [Teletha]: https://github.com/teletha [Nicolas Stucki]: https://github.com/nicolasstucki [Bahnschrift]: https://github.com/Bahnschrift [Melvyn Laïly]: https://github.com/mlaily [katzeprior]: https://github.com/katzeprior [zsoltlengyelit]: github.com/zsoltlengyelit [Syb Wartna]:https://github.com/waarissyb [idleberg]: https://github.com/idleberg [ierehon1905]: https://github.com/ierehon1905 ## Version 11.2.0 Build: - fix: run Node build CSS files thru CSS processor also (#3284) [Josh Goebel][] Parser: - fix(csharp) Fix assignments flagging as functions [Josh Goebel][] - fix(types) Fix some type definition issues (#3274) [Josh Goebel][] - fix(verilog) Fix directive handling (#3283) [Josh Goebel][] - fix(verilog) Fix binary number false positives on `_` (#3283) [Josh Goebel][] - enh(verilog) `__FILE__` and `__LINE__` constants (#3283) [Josh Goebel][] - enh(verilog) tighten keyword regex (#3283) [Josh Goebel][] Grammars: - enh(swift) Add `isolated`/`nonisolated` keywords (#3296) [Bradley Mackey][] New Languages: - Added 3rd party X# grammar to SUPPORTED_LANGUAGES [Patrick Kruselburger][] - Added 3rd party MKB grammar to SUPPORTED_LANGUAGES (#3297) [Dereavy][] [Josh Goebel]: https://github.com/joshgoebel [Patrick Kruselburger]: https://github.com/PatrickKru [Bradley Mackey]: https://github.com/bradleymackey [Dereavy]: https://github.com/dereavy ## Version 11.1.0 Grammars: - fix(csharp) add missing `catch` keyword (#3251) [Konrad Rudolph][] - add additional keywords to csp.js (#3244) [Elijah Conners][] - feat(css) handle css variables syntax (#3239) [Thanos Karagiannis][] - fix(markdown) Images with empty alt or links with empty text (#3233) [Josh Goebel][] - enh(powershell) added `pwsh` alias (#3236) [tebeco][] - fix(r) fix bug highlighting examples in doc comments [Konrad Rudolph][] - fix(python) identifiers starting with underscore not highlighted (#3221) [Antoine Lambert][] - enh(clojure) added `edn` alias (#3213) [Stel Abrego][] - enh(elixir) much improved regular expression sigil support (#3207) [Josh Goebel][] - enh(elixir) updated list of keywords (#3212) [Angelika Tyborska][] - fix(elixir) fixed number detection when numbers start with a zero (#3212) [Angelika Tyborska][] - fix(ps1) Flag highlighted incorrectly (#3167) [Pankaj Patil][] - fix(latex) Allow wider syntax for magic comments (#3243) [Benedikt Wilde][] - fix(js/ts) Constants may include numbers [Josh Goebel][] [Stel Abrego]: https://github.com/stelcodes [Josh Goebel]: https://github.com/joshgoebel [Antoine Lambert]: https://github.com/anlambert [Elijah Conners]: https://github.com/elijahepepe [Angelika Tyborska]: https://github.com/angelikatyborska [Konrad Rudolph]: https://github.com/klmr [tebeco]: https://github.com/tebeco [Pankaj Patil]: https://github.com/patil2099 [Benedikt Wilde]: https://github.com/schtandard [Thanos Karagiannis]: https://github.com/thanoskrg ## Version 11.0.0 **This is a major release.** As such it contains breaking changes which may require action from users. Please read [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_11_UPGRADE.md) for a detailed summary of all breaking changes. ### Potentially breaking changes Unless otherwise attributed items below are thanks to [Josh Goebel][] (ref: [#2558](https://github.com/highlightjs/highlight.js/issues/2558)). *The below list should only be considered to be a high-level summary.* Deprecations / Removals / API Changes: - `initHighlighting()` and `initHighlightingOnLoad()` deprecated. **Use `highlightAll()`.** - `highlightBlock(el)` deprecated. **Use `highlightElement(el)`** - `before:highlightBlock` & `after:highlightBlock` callbacks deprecated. **Use equivalent `highlightElement` callbacks.** - `highlight(languageName, code, ignoreIllegals, continuation)` signature deprecated. **Use `highlight(code, {language, ignoreIllegals})`.** - Deprecated `highlight()` signature no longer supports `continuation` argument. - `tabReplace` option removed. Consider a plugin. - `useBR` option removed. Consider a plugin or CSS. - `requireLanguage()` removed. **Use `getLanguage()`.** - `endSameAsBegin` mode key removed. **Use `hljs.END_SAME_AS_BEGIN`.** - `lexemes` mode key removed. **Use `keywords.$pattern`.** - The return values/keys of some APIs have changed slightly. Security: - HTML auto-passthru has been removed. Consider a plugin. - Unescaped HTML is now stripped (for security). A warning is logged to the console. (#3057) [Josh Goebel][] Themes: - The default padding of all themes increases (0.5em => 1em). - `schoolbook` has been updated to remove the lined background. - `github` updated to better match modern GitHub (#1616) [Jan Pilzer][] - `github-gist` has been removed in favor of `github` [Jan Pilzer][] - Base16 named themes have been updated to their "canonical" versions - `nnfx` updated for v11 xml styles and improved css support Language Grammars: - Default CDN build drops support for several languages. - Some language grammar files have been removed. - Some redundant language aliases have been removed. ### Other changes Parser: - enh(vala) improve language detection for Vala (#3195) [Konrad Rudolph][] - enh(r) add support for operators, fix number highlighting bug (#3194, #3195) [Konrad Rudolph][] - enh(parser) add `beginScope` and `endScope` to allow separate scoping begin and end (#3159) [Josh Goebel][] - enh(parsed) `endScope` now supports multi-class matchers as well (#3159) [Josh Goebel][] - enh(parser) `highlightElement` now always tags blocks with a consistent `language-[name]` class [Josh Goebel][] - subLanguage `span` tags now also always have the `language-` prefix added - enh(parser) support multi-class matchers (#3081) [Josh Goebel][] - enh(parser) Detect comments based on english like text, rather than keyword list [Josh Goebel][] - adds `title.class.inherited` sub-scope support [Josh Goebel][] - adds `title.class` sub-scope support (#3078) [Josh Goebel][] - adds `title.function` sub-scope support (#3078) [Josh Goebel][] - adds `beforeMatch` compiler extension (#3078) [Josh Goebel][] - adds `cssSelector ` configuration option (#3180) [James Edington][] Grammars: - enh(all) `.meta-keyword` => `.meta .keyword` (nested scopes) (#3167) [Josh Goebel][] - enh(all) `.meta-string` => `.meta .string` (nested scopes) (#3167) [Josh Goebel][] - enh(swift) add `actor` keyword (#3171) [Bradley Mackey][] - enh(crystal) highlight variables (#3154) [Josh Goebel][] - fix(ruby) Heredoc without interpolation (#3154) [Josh Goebel][] - enh(swift) add `@resultBuilder` attribute (#3151) [Bradley Mackey][] - enh(processing) added `pde` alias (#3142) [Dylan McBean][] - enh(thrift) Use proper scope for types [Josh Goebel][] - enh(java) Simplified class-like matcher (#3078) [Josh Goebel][] - enh(cpp) Simplified class-like matcher (#3078) [Josh Goebel][] - enh(rust) Simplified class-like matcher (#3078) [Josh Goebel][] - enh(actionscript) Simplified class-like matcher (#3078) [Josh Goebel][] - enh(arcade) `function.title` => `title.function` (#3078) [Josh Goebel][] - enh(autoit) `function.title` => `title.function` (#3078) [Josh Goebel][] - enh(c) `function.title` => `title.function` (#3078) [Josh Goebel][] - enh(rust) support function invoke and `impl` (#3078) [Josh Goebel][] - chore(properties) disable auto-detection #3102 [Josh Goebel][] - fix(properties) fix incorrect handling of non-alphanumeric keys #3102 [Egor Rogov][] - enh(java) support functions with nested template types (#2641) [Josh Goebel][] - enh(java) highlight types and literals separate from keywords (#3074) [Josh Goebel][] - enh(shell) add alias ShellSession [Ryan Mulligan][] - enh(shell) consider one space after prompt as part of prompt [Ryan Mulligan][] - fix(nginx) fix bug with $ and @ variables [Josh Goebel][] - enh(nginx) improving highlighting of some sections [Josh Goebel][] - fix(vim) variable names may not be zero length [Josh Goebel][] - enh(sqf) Updated keywords to Arma 3 v2.02 (#3084) [R3voA3][] - enh(sqf) Refactored function regex to match CBA component func naming scheme (#3181) [JonBons][] - enh(nim) highlight types properly (not as built-ins) [Josh Goebel][] - (chore) throttle deprecation messages (#3092) [Mihkel Eidast][] - enh(c) Update keyword list for C11/C18 (#3010) [Josh Goebel][] - enh(parser) highlight object properties (#3072) [Josh Goebel][] - enh(javascript/typescript) highlight object properties (#3072) [Josh Goebel][] - enh(haskell) add support for BinaryLiterals (#3150) [Martijn Bastiaan][] - enh(haskell) add support for NumericUnderscores (#3150) [Martijn Bastiaan][] - enh(haskell) add support for HexFloatLiterals (#3150) [Martijn Bastiaan][] - fix(c,cpp) allow declaring multiple functions and (for C++) parenthetical initializers (#3155) [Erik Demaine][] - enh(rust) highlight raw byte string literals correctly (#3173) [Nico Abram][] - fix(cpp) fix detection of common functions that are function templates (#3178) [Kris van Rens][] - enh(cpp) add various keywords and commonly used types for hinting (#3178) [Kris van Rens][] - enh(cpp) cleanup reserved keywords and type lists (#3178) [Kris van Rens][] New Languages: - Added 3rd party Glimmer grammar to SUPPORTED_LANGUAGES(#3123) [NullVoxPopuli][] - Added Wren support [Josh Goebel][] - Added NestedText support [Josh Goebel][] - Added WebAssembly language grammar [Josh Goebel][] - Added 3rd party Splunk search processing language grammar to SUPPORTED_LANGUAGES (#3090) [Wei Su][] - Added 3rd party ZenScript grammar to SUPPORTED_LANGUAGES(#3106) [Jared Luboff][] - Added 3rd party Papyrus grammar to SUPPORTED_LANGUAGES(#3125) [Mike Watling][] Theme Improvements: - Added all official Base16 themes (over 150 new themes) [Josh Goebel][] - chore(themes) remove `builtin-name` CSS class (#3119) [Josh Goebel][] - chore(theme) Update GitHub theme css to match GitHub's current styling (#1616) [Jan Pilzer][] - chore(theme) Update Srcery theme css to match its Emacs implementation [Chen Bin][] New Themes: - DeviBeans Dark by [Farzad Sadeghi][] - GitHub Dark and GitHub Dark Dimmed [Jan Pilzer][] Dev Improvements: - (chore) greatly improve match scope visualization in dev tool (#3126) [NullVoxPopuli][] - (fix) CSS used for devtool needed an adjustment to fix too wide of content (#3133) [NullVoxPopuli][] [Farzad Sadeghi]: https://github.com/terminaldweller [Martijn Bastiaan]: https://github.com/martijnbastiaan [Bradley Mackey]: https://github.com/bradleymackey [Dylan McBean]: https://github.com/DylanMcBean [Josh Goebel]: https://github.com/joshgoebel [Ryan Mulligan]: https://github.com/ryantm [R3voA3]: https://github.com/R3voA3 [JonBons]: https://github.com/JonBons [Wei Su]: https://github.com/swsoyee [Jared Luboff]: https://github.com/jaredlll08 [NullVoxPopuli]: https://github.com/NullVoxPopuli [Mike Watling]: https://github.com/Pickysaurus [Nico Abram]: https://github.com/nico-abram [James Edington]: http://www.ishygddt.xyz/ [Jan Pilzer]: https://github.com/Hirse [Kris van Rens]: https://github.com/krisvanrens ## Version 10.7.1 - fix(parser) Resolves issues with TypeScript types [Josh Goebel][] ### Version 10.7.0 Parser: - keywords now have a maximum # of times they provide relevance (#3129) [Josh Goebel][] - enh(api) add `unregisterLanguage` method (#3009) [Antoine du Hamel][] - enh: Make alias registration case insensitive (#3026) [David Ostrovsky][] - fix(parser) `highlightAll()` now works if the library is lazy loaded [Josh Goebel][] New Languages: - Added 3rd party RiScript grammar to SUPPORTED_LANGUAGES (#2988) [John C][] - Added 3rd party HLSL grammar to SUPPORTED_LANGUAGES (#3002) [Stef Levesque][] - Added 3rd party Q# grammar to SUPPORTED_LANGUAGES(#3006) [Vyron Vasileiadis][] Language grammar improvements: - enh(js/ts) class references (CamelCase) are highlighted (#3169) [Josh Goebel][] - enh(js/ts) constants (ALL_CAPS) are highlighted (#3169) [Josh Goebel][] - enh(js/ts) highlights function invokation (#3169) [Josh Goebel][] - enh(js/ts) functions assigned to variables are now highlighted `title.function` (#3169) [Josh Goebel][] - enh(parser) smarter detection of comments (#2827) [Josh Goebel][] - fix(python) allow keywords immediately following numbers (#2985) [Josh Goebel][] - fix(xml) char immediately following tag close mis-highlighted (#3044) [Josh Goebel][] - fix(ruby) fix `defined?()` mis-highlighted as `def` (#3025) [Josh Goebel][] - fix(c) comments after `#include ` blocks (#3041) [Josh Goebel][] - fix(cpp) comments after `#include ` blocks (#3041) [Josh Goebel][] - enh(cpp) Highlight all function dispatches (#3005) [Josh Goebel][] - enh(python) support type hints and better type support (#2972) [Josh Goebel][] - enh(gml) Add additional GML 2.3 keywords (#2984) [xDGameStudios][] - fix(cpp) constructor support for initializers (#3001) [Josh Goebel][] - enh(php) Add `trait` to class-like naming patterns (#2997) [Ayesh][] - enh(php) Add `Stringable`, `UnhandledMatchError`, and `WeakMap` classes/interfaces (#2997) [Ayesh][] - enh(php) Add `mixed` to list of keywords (#2997) [Ayesh][] - enh(php) Add support binary, octal, hex and scientific numerals with underscore separator support (#2997) [Ayesh][] - enh(php) Add support for Enums (#3004) [Ayesh][] - enh(ecmascript) Add built-in types [Vaibhav Chanana][] - enh(kotlin) Add `kts` as an alias for Kotlin (#3021) [Vaibhav Chanana][] - enh(css) Add `font-smoothing` to attributes list for CSS (#3027) [AndyKIron][] - fix(python) Highlight `print` and `exec` as a builtin (#1468) [Samuel Colvin][] - fix(csharp) Fix unit being highlighted instead of uint (#3046) [Spacehamster][] - enh(swift) add async/await keywords (#3048) [Bradley Mackey][] Deprecations: - `highlight(languageName, code, ignoreIllegals, continuation)` deprecated as of 10.7 - Please use the newer API which takes `code` and then accepts options as an object - IE: `highlight(code, {language, ignoreIllegals})` - `continuation` is for internal use only and no longer supported - `highlightBlock(el)` deprecated as of 10.7. - Please use `highlightElement(el)` instead. - Plugin callbacks renamed `before/after:highlightBlock` => `before/after:highlightElement` - Plugin callback now takes `el` vs `block` attribute - The old API and callbacks will be supported until v12. [Stef Levesque]: https://github.com/stef-levesque [Josh Goebel]: https://github.com/joshgoebel [John Cheung]: https://github.com/Real-John-Cheung [xDGameStudios]: https://github.com/xDGameStudios [Ayesh]: https://github.com/Ayesh [Vyron Vasileiadis]: https://github.com/fedonman [Antoine du Hamel]: https://github.com/aduh95 [Vaibhav Chanana]: https://github.com/il3ven [David Ostrovsky]: https://github.com/davido [AndyKIron]: https://github.com/AndyKIron [Samuel Colvin]: https://github.com/samuelcolvin ## Version 10.6.0 New Languages: - Added 3rd party Laravel Blade grammar to SUPPORTED_LANGUAGES (#2944) [Michael Newton][] Language grammar improvements: - enh(scala) fix triple quoted strings (#2987) [Josh Goebel][] - enh(perl) Much improved regex detection (#2960) [Josh Goebel][] - enh(swift) Improved highlighting for operator and precedencegroup declarations. (#2938) [Steven Van Impe][] - fix(xml) Support single-character namespaces. (#2957) [Jan Pilzer][] - enh(ruby) Support for character literals (#2950) [Vaibhav Chanana][] - enh(powershell) Add three VALID_VERBS and update the reference link (#2981) [davidhcefx][] - fix(php) Highlighting of anonymous functions without {} block [Vaibhav Chanana][] Grammar Deprecations: - Deprecate `c-like`, though you should not be using it directly anyways. - will be removed in v11. - `c` and `cpp` are now wholly unique grammars that will diverge over time Parser: - new simpler `highlightAll()` API (#2962) [Josh Goebel][] - this should be a drop-in replacement for both `initHighlighting()` and `initHighlightingOnLoad()` - note: it does not prevent itself from being called multiple times (as the previous API did) - `beginKeyword` no longer bestows double relevance (#2953) [Josh Goebel][] - allow `keywords` to be an array of strings [Josh Goebel][] - add `modes.MATCH_NOTHING_RE` that will never match - This can be used with `end` to hold a mode open (it must then be ended with `endsParent` in one of it's children modes) [Josh Goebel][] Deprecations: - `initHighlighting()` and `initHighlightingOnLoad()` deprecated. - Please use the new `highlightAll()` API instead. - Deprecated as of 10.6. - These will both be aliases to `highlightAll` in v11. [Michael Newton]: https://github.com/miken32 [Steven Van Impe]: https://github.com/svanimpe/ [Josh Goebel]: https://github.com/joshgoebel [Vaibhav Chanana]: https://github.com/il3ven [davidhcefx]: https://github.com/davidhcefx [Jan Pilzer]: https://github.com/Hirse ## Version 10.5.0 Build: - Add Subresource Integrity digest lists to `cdn-assets` [Josh Goebel][] - R and VB.net grammars now ship in our default build (`:common`) [Josh Goebel][] Parser: - add `match` as sugar for simple `begin` only matches (#2834) [Josh Goebel][] - allow `illegal` to also be an array of regex (#2834) [Josh Goebel][] - add `compilerExtensions` allows grammers to influence mode compilation (#2834) [Josh Goebel][] - some internal pieces are now simple compiler extensions New Languages: - Added 3rd party Red & Rebol grammar to SUPPORTED_LANGUAGES (#2872) [Oldes Huhuman][] Language grammar improvements: - enh: CSS grammars now share common foundation, keywords, etc. (#2937) [Josh Goebel][] - enh(css): many consistency improvements - enh(scss): many consistency improvements - enh(stylus): many consistency improvements - enh(less): many consistency improvements - enh(cpp): Support C++ pack expansion in function arguments [Martin Dørum][] - enh(makefile): Add `make` as an alias (#2883) [tripleee][] - enh(swift) Improved grammar for strings (#2819) [Steven Van Impe][] - enh(swift) Grammar improvements (#2908) [Steven Van Impe][] - New grammar for keywords and built-ins - Added support for operator highlighting - New grammar for attributes - Added support for quoted identifiers, implicit parameters, and property wrapper projections - Support for more complex expressions in string interpolation - enh(swift) Improved highlighting for types and generic arguments (#2920) [Steven Van Impe][] - enh(swift) Improved highlighting for functions, initializers, and subscripts (#2930) [Steven Van Impe][] - fix(http) avoid recursive sublanguage and tighten rules (#2893) [Josh Goebel][] - fix(asciidoc): Handle section titles level 5 (#2868) [Vaibhav Chanana][] - fix(asciidoc): Support unconstrained emphasis syntax (#2869) [Guillaume Grossetie][] - enh(scheme) Allow `[]` for argument lists (#2913) [Josh Goebel][] - enh(vb) Large rework of VB.net grammar (#2808) [Jan Pilzer][] - Adds support for Date data types, see (#2775) - Adds support for `REM` comments and fixes `'''` doctags (#2875) (#2851) - Custom number mode to support VB.net specific number flags - Hex (&H), Oct (&O), and binary (&B) prefixes - Separating digits with underscores: 90_946 - Type suffixes: 123UI (unsigned integer) - Improves directives detection and adds support for `Enable`, `Disable`, and `Then` keywords - Adds more markup tests - fix(javascript) Empty block-comments break highlighting (#2896) [Jan Pilzer][] - enh(dart) Fix empty block-comments from breaking highlighting (#2898) [Jan Pilzer][] - enh(dart) Fix empty doc-comment eating next line [Jan Pilzer][] - enh(asciidoc) Adds support for unconstrained bold syntax (#2869) [Guillaume Grossetie][] - enh(c-like) Incorrect highlighting for interger suffix (#2919) [Vaibhav Chanana][] - enh(properties) Correctly handle trailing backslash (#2922) [Vaibhav Chanana][] Recent Deprecations: - HTML "merging" is deprecated. (#2873) [Josh Goebel][] - HTML inside `
` blocks will no longer be magically merged back into the
  highlighted code's HTML result - it will instead be silently removed.
  - Consider [using a plugin][htmlPlugin] if you truly need this functionality
  - Deprecated as of 10.5.0 - will be removed in v11.
- `tabReplace` option deprecated. (#2873) [Josh Goebel][]
  - **Consider:** Use the CSS `tab-size` property, or simply pre-process the
    text yourself before rendering the initial HTML
  - otherwise, [use a plugin][tabPlugin]
  - Deprecated as of 10.5.0 - will be removed in v11.
- `useBR` option deprecated. (#2559) [Josh Goebel][]
  - **Recommended:** You really should just use the HTML `
` tag
  - or perhaps try CSS `white-space: pre;`
  - otherwise, [use a plugin][brPlugin]
  - Deprecated as of 10.3.0 - will be removed in v11.
- `requireLanguage` API is deprecated, will be removed in v11.0.
  - **Consider:** Use `getLanguage` (with custom error handling) or built-time dependencies.
  - See [Library API](https://highlightjs.readthedocs.io/en/latest/api.html#requirelanguage-name) for more information.
  - Deprecated as of 10.4.0 - will be removed in v11.

[htmlPlugin]: https://github.com/highlightjs/highlight.js/issues/2889
[tabPlugin]: https://github.com/highlightjs/highlight.js/issues/2874
[brPlugin]: https://github.com/highlightjs/highlight.js/issues/2559

[Martin Dørum]: https://github.com/mortie
[Jan Pilzer]: https://github.com/Hirse
[Oldes Huhuman]: https://github.com/Oldes
[Josh Goebel]: https://github.com/joshgoebel
[tripleee]: https://github.com/tripleee
[Steven Van Impe]: https://github.com/svanimpe/
[Vaibhav Chanana]: https://github.com/il3ven
[Guillaume Grossetie]: https://github.com/mogztter


## Version 10.4.1 (tentative)

Security

- (fix) Exponential backtracking fixes for: [Josh Goebel][]
  - cpp
  - handlebars
  - gams
  - perl
  - jboss-cli
  - r
  - erlang-repl
  - powershell
  - routeros
- (fix) Polynomial backtracking fixes for: [Josh Goebel][]
  - asciidoc
  - reasonml
  - latex
  - kotlin
  - gcode
  - d
  - aspectj
  - moonscript
  - coffeescript/livescript
  - csharp
  - scilab
  - crystal
  - elixir
  - basic
  - ebnf
  - ruby
  - fortran/irpf90
  - livecodeserver
  - yaml
  - x86asm
  - dsconfig
  - markdown
  - ruleslanguage
  - xquery
  - sqf

Very grateful to [Michael Schmidt][] for all the help.

[Michael Schmidt]: https://github.com/RunDevelopment
[Josh Goebel]: https://github.com/joshgoebel


## Version 10.4.0

A largish release with many improvements and fixes from quite a few different contributors.  Enjoy!

Deprecations:

- (chore) `requireLanguage` is deprecated.
  - Prefer `getLanguage` (with custom error handling) or built-time dependencies.
  - See [Library API](https://highlightjs.readthedocs.io/en/latest/api.html#requirelanguage-name) for more information.

Parser:

- enh(parser) use negative look-ahead for `beginKeywords` support (#2813) [Josh Goebel][]
- enh(grammars) allow `classNameAliases` for more complex grammars [Josh Goebel][]
- fix(vue): Language name now appears in CSS class (#2807) [Michael Rush][]
- (chore) Clean up all regexs to be UTF-8 compliant/ready (#2759) [Josh Goebel][]
- enh(grammars) allow `classNameAliases` for more complex grammars [Josh Goebel][]

New Languages:

- Added 3rd party Chapel grammar to SUPPORTED_LANGUAGES (#2806) [Brad Chamberlain][]
- Added BBCode grammar to SUPPORTED_LANGUAGES (#2867) [Paul Reid][]
- enh(javascript) Added `node-repl` for Node.js REPL sessions (#2792) [Marat Nagayev][]

Language Improvements:

- enh(shell) Recognize prompts which contain tilde `~` (#2859) [Guillaume Grossetie][]
- enh(shell) Add support for multiline commands with line continuation `\` (#2861) [Guillaume Grossetie][]
- enh(autodetect) Over 30+ improvements to auto-detect (#2745) [Josh Goebel][]
    - 4-5% improvement in auto-detect against large sample set
    - properties, angelscript, lsl, javascript, n1ql, ocaml, ruby
    - protobuf, hy, scheme, crystal, yaml, r, vbscript, groovy
    - python, java, php, lisp, matlab, clojure, csharp, css
- fix(r) fixed keywords not properly spaced (#2852) [Josh Goebel][]
- fix(javascript) fix potential catastrophic backtracking (#2852) [Josh Goebel][]
- fix(livescript) fix potential catastrophic backtracking (#2852) [Josh Goebel][]
- bug(xml) XML grammar was far too imprecise/fuzzy [Josh Goebel][]
- enh(xml) Improve precision to prevent false auto-detect positives [Josh Goebel][]
- fix(js/ts) Prevent for/while/if/switch from falsly matching as functions (#2803) [Josh Goebel][]
- enh(julia) Update keyword lists for Julia 1.x (#2781) [Fredrik Ekre][]
- enh(python) Match numeric literals per the language reference [Richard Gibson][]
- enh(ruby) Match numeric literals per language documentation [Richard Gibson][]
- enh(javascript) Match numeric literals per ECMA-262 spec [Richard Gibson][]
- enh(java) Match numeric literals per Java Language Specification [Richard Gibson][]
- enh(swift) Match numeric literals per language reference [Richard Gibson][]
- enh(php) highlight variables (#2785) [Taufik Nurrohman][]
- fix(python) Handle comments on decorators (#2804) [Jonathan Sharpe][]
- enh(diff) improve highlighting of diff for git patches [Florian Bezdeka][]
- fix(llvm) lots of small improvements and fixes (#2830) [Josh Goebel][]
- enh(mathematica) Rework entire implementation [Patrick Scheibe][]
  - Correct matching of the many variations of Mathematica's numbers
  - Matching of named-characters aka special symbols like `\[Gamma]`
  - Updated list of version 12.1 built-in symbols
  - Matching of patterns, slots, message-names and braces
- fix(swift) Handle keywords that start with `#` [Marcus Ortiz][]
- enh(swift) Match `some` keyword [Marcus Ortiz][]
- enh(swift) Match `@main` attribute [Marcus Ortiz][]

Dev Improvements:

- chore(dev) add theme picker to the tools/developer tool (#2770) [Josh Goebel][]
- fix(dev) the Vue.js plugin no longer throws an exception when hljs is not in the global namespace [Kyle Brown][]

New themes:

- *StackOverflow Dark* by [Jan Pilzer][]
- *StackOverflow Light* by [Jan Pilzer][]

[Guillaume Grossetie]: https://github.com/mogztter
[Brad Chamberlain]: https://github.com/bradcray
[Marat Nagayev]: https://github.com/nagayev
[Fredrik Ekre]: https://github.com/fredrikekre
[Richard Gibson]: https://github.com/gibson042
[Josh Goebel]: https://github.com/joshgoebel
[Taufik Nurrohman]: https://github.com/taufik-nurrohman
[Jan Pilzer]: https://github.com/Hirse
[Jonathan Sharpe]: https://github.com/textbook
[Michael Rush]: https://github.com/rushimusmaximus
[Patrick Scheibe]: https://github.com/halirutan
[Kyle Brown]: https://github.com/kylebrown9
[Marcus Ortiz]: https://github.com/mportiz08
[Paul Reid]: https://github.com/RedGuy12


## Version 10.3.1

Prior version let some look-behind regex sneak in, which does not work
yet on Safari.  This release removes those incompatible regexes.

Fix:

- fix(Safari) Remove currently unsupported look-behind regex ([fix][187e7cfc]) [Josh Goebel][]

[Josh Goebel]: https://github.com/joshgoebel
[187e7cfc]: https://github.com/highlightjs/highlight.js/commit/187e7cfcb06277ce13b5f35fb6c37ab7a7b46de9


## Version 10.3.0

Language Improvements:

- enh(latex) Complete ground up rewrite of LaTex grammar [schtandard][]
- fix(cpp) implement backslash line continuation in comments (#2757) [Konrad Rudolph][]
- fix(cpp) improve parsing issues with templates (#2752) [Josh Goebel][]
- enh(cpp) add support for `enum (struct|class)` and `union` (#2752) [Josh Goebel][]
- fix(js/ts) Fix nesting of `{}` inside template literals SUBST expression (#2748) [Josh Goebel][]
- enh(js/ts) Highlight class methods as functions (#2727) [Josh Goebel][]
- fix(js/ts) `constructor` is now highlighted as a function title (not keyword) (#2727) [Josh Goebel][]
- fix(c-like) preprocessor directives not detected after else (#2738) [Josh Goebel][]
- enh(javascript) allow `#` for private class fields (#2701) [Chris Krycho][]
- fix(js) prevent runaway regex (#2746) [Josh Goebel][]
- fix(bash) enh(bash) allow nested params (#2731) [Josh Goebel][]
- fix(python) Fix highlighting of keywords and strings (#2713, #2715) [Konrad Rudolph][]
- fix(fsharp) Prevent `(*)` from being detected as a multi-line comment [Josh Goebel][]
- enh(bash) add support for heredocs (#2684) [Josh Goebel][]
- enh(r) major overhaul of the R language grammar (and fix a few bugs) (#2680) [Konrad Rudolph][]
- enh(csharp) Add all C# 9 keywords, and other missing keywords (#2679) [David Pine][]
- enh(objectivec) Add `objective-c++` and `obj-c++` aliases for Objective-C [Josh Goebel][]
- enh(java) Add support for `record` (#2685) [Josh Goebel][]
- fix(csharp) prevent modifier keywords wrongly flagged as `title` (#2683) [Josh Goebel][]
- enh(axapta) Update keyword list for Axapta (X++) (#2686) [Ryan Jonasson][]
- fix(fortran) FORTRAN 77-style comments (#2677) [Philipp Engel][]
- fix(javascript) Comments inside params should be highlighted (#2702) [Josh Goebel][]
- fix(scala) Comments inside class header should be highlighted (#1559) [Josh Goebel][]
- fix(c-like) Correctly highlight modifiers (`final`) in class declaration (#2696) [Josh Goebel][]
- enh(angelscript) Improve heredocs, numbers, metadata blocks (#2724) [Melissa Geels][]
- enh(javascript) Implement Numeric Separators (#2617) [Antoine du Hamel][]
- enh(typescript) TypeScript also gains support for numeric separators (#2617) [Antoine du Hamel][]
- enh(php) Add support for PHP 8 `match` keyword and add `php8` as an alias (#2733) [Ayesh Karunaratne][]
- fix(handlebars) Support if else keyboards (#2659) [Tom Wallace][]

Deprecations:

- `useBR` option deprecated and will be removed in v11.0. (#2559) [Josh Goebel][]

[Chris Krycho]: https://github.com/chriskrycho
[David Pine]: https://github.com/IEvangelist


[Ryan Jonasson]: https://github.com/ryanjonasson
[Philipp Engel]: https://github.com/interkosmos
[Konrad Rudolph]: https://github.com/klmr
[Melissa Geels]: https://github.com/codecat
[Antoine du Hamel]: https://github.com/aduh95
[Ayesh Karunaratne]: https://github.com/Ayesh
[Tom Wallace]: https://github.com/thomasmichaelwallace
[schtandard]: https://github.com/schtandard


## Version 10.2.1

 Parser Engine:

 -  fix(parser) complete fix for resuming matches from same index (#2678) [Josh Goebel][]

 [Josh Goebel]: https://github.com/yyyc514


## Version 10.2.0

Parser Engine:

- (fix) When ignoring a potential match highlighting can terminate early (#2649) [Josh Goebel][]


New themes:

- *Gradient Light* by [Samia Ali]()

Deprecations:

- `fixMarkup` is now deprecated and will be removed in v11.0. (#2534) [Josh Goebel][]

Big picture:

- Add simple Vue plugin for basic use cases (#2544) [Josh Goebel][]

Language Improvements:

- fix(bash) Fewer false positives for keywords in arguments (#2669) [sirosen][]
- fix(js) Prevent long series of /////// from causing freezes (#2656) [Josh Goebel][]
- enh(csharp) Add `init` and `record` keywords for C# 9.0 (#2660) [Youssef Victor][]
- enh(matlab) Add new R2019b `arguments` keyword and fix `enumeration` keyword (#2619) [Andrew Janke][]
- fix(kotlin) Remove very old keywords and update example code (#2623) [kageru][]
- fix(night) Prevent object prototypes method values from being returned in `getLanguage` (#2636) [night][]
- enh(java) Add support for `enum`, which will identify as a `class` now (#2643) [ezksd][]
- enh(nsis) Add support for NSIS 3.06 commands (#2653) [idleberg][]
- enh(php) detect newer more flexible HEREdoc syntax (#2658) [eytienne][]

[Youssef Victor]: https://github.com/Youssef1313
[Josh Goebel]: https://github.com/joshgoebel
[Andrew Janke]: https://github.com/apjanke
[Samia Ali]: https://github.com/samiaab1990
[kageru]: https://github.com/kageru
[night]: https://github.com/night
[ezksd]: https://github.com/ezksd
[idleberg]: https://github.com/idleberg
[eytienne]: https://github.com/eytienne
[sirosen]: https://github.com/sirosen

## Version 10.1.1

Fixes:

- Resolve issue on Node 6 due to dangling comma (#2608) [Edwin Hoogerbeets][]
- Resolve `index.d.ts is not a module` error (#2603) [Josh Goebel][]

[Josh Goebel]: https://github.com/joshgoebel
[Edwin Hoogerbeets]: https://github.com/ehoogerbeets


## Version 10.1.0

New themes:

- *NNFX* and *NNFX-dark* by [Jim Mason][]
- *lioshi* by [lioshi][]

Parser Engine:

- (parser) Now escapes quotes in text content when escaping HTML (#2564) [Josh Goebel][]
- (parser) Adds `keywords.$pattern` key to grammar definitions (#2519) [Josh Goebel][]
- (parser) Adds SHEBANG utility mode [Josh Goebel][]
- (parser) Adds `registerAliases` method (#2540) [Taufik Nurrohman][]
- (enh) Added `on:begin` callback for modes (#2261) [Josh Goebel][]
- (enh) Added `on:end` callback for modes (#2261) [Josh Goebel][]
- (enh) Added ability to programatically ignore begin and end matches (#2261) [Josh Goebel][]
- (enh) Added `END_SAME_AS_BEGIN` mode to replace `endSameAsBegin` parser attribute (#2261) [Josh Goebel][]
- (fix) `fixMarkup` would rarely destroy markup when `useBR` was enabled (#2532) [Josh Goebel][]

Deprecations:

- `htmlbars` grammar is now deprecated. Use `handlebars` instead. (#2344) [Nils Knappmeier][]
- 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][]

Language Improvements:

- fix(groovy) strings are not allowed inside ternary clauses (#2217) [Josh Goebel][]
- fix(typescript) add `readonly` keyword (#2562) [Martin (Lhoerion)][]
- fix(javascript) fix regex inside parens after a non-regex (#2530) [Josh Goebel][]
- enh(typescript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][]
- enh(javascript) use identifier to match potential keywords, preventing false positivites (#2519) [Josh Goebel][]
- [enh] Add `OPTIMIZE:` and `HACK:` to the labels highlighted inside comments [Josh Goebel][]
- enh(typescript/javascript/coffeescript/livescript) derive ECMAscript keywords from a common foudation (#2518) [Josh Goebel][]
- enh(typescript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Josh Goebel][]
- enh(javascript) add setInterval, setTimeout, clearInterval, clearTimeout (#2514) [Vania Kucher][]
- enh(cpp) add `pair`, `make_pair`, `priority_queue` as built-ins (#2538) [Hankun Lin][]
- enh(cpp) recognize `priority_queue` `pair` as cpp containers (#2541) [Hankun Lin][]
- fix(javascript) prevent `set` keyword conflicting with setTimeout, etc. (#2514) [Vania Kucher][]
- fix(cpp) Fix highlighting of unterminated raw strings (#2261) [David Benjamin][]
- fix(javascript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][]
- fix(typescript) `=>` function with nested `()` in params now works (#2502) [Josh Goebel][]
- 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, the `Never` built-in type, and nullable built-in types (#2550) [Sam Rawlins][]
- enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][]
- enh(handlebars) Support for sub-expressions, path-expressions, hashes, block-parameters and literals (#2344) [Nils Knappmeier][]
- enh(protobuf) Support multiline comments (#2597) [Pavel Evstigneev][]
- fix(toml) Improve key parsing (#2595) [Antoine du Hamel][]

[Josh Goebel]: https://github.com/joshgoebel
[Peter Plantinga]: https://github.com/pplantinga
[David Benjamin]: https://github.com/davidben
[Vania Kucher]: https://github.com/qWici
[Hankun Lin]: https://github.com/Linhk1606
[Nick Randall]: https://github.com/nicked
[Sam Rawlins]: https://github.com/srawlins
[Sergey Prokhorov]: https://github.com/seriyps
[Nils Knappmeier]: https://github.com/nknapp
[Martin (Lhoerion)]: https://github.com/Lhoerion
[Jim Mason]: https://github.com/RocketMan
[lioshi]: https://github.com/lioshi
[Pavel Evstigneev]: https://github.com/Paxa
[Antoine du Hamel]: https://github.com/aduh95


## Version 10.0.2

Brower build:

- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (bug) Fix: Version 10 fails to load as CommonJS module. (#2511) [Josh Goebel][]
- [Issue](https://github.com/highlightjs/highlight.js/issues/2505) (removal) AMD module loading support has been removed. (#2511) [Josh Goebel][]

Parser Engine Changes:

- [Issue](https://github.com/highlightjs/highlight.js/issues/2522) fix(parser) Fix freez issue with illegal 0 width matches (#2524) [Josh Goebel][]


[Josh Goebel]: https://github.com/joshgoebel


## Version 10.0.1

Parser Engine Changes:

- (bug) Fix sublanguage with no relevance score (#2506) [Josh Goebel][]

[Josh Goebel]: https://github.com/joshgoebel


## Version 10.0.0

New languages:

- add(php-template) Explicit language to detect PHP templates (vs xml) [Josh Goebel][]
- enh(python) Added `python-repl` for Python REPL sessions
- add(never) Added 3rd party Never language support

New themes:

- *Srcery* by [Chen Bin][]

Parser Engine Changes:

- (bug) Fix `beginKeywords` to ignore . matches (#2434) [Josh Goebel][]
- (enh) add `before:highlight` plugin API callback (#2395) [Josh Goebel][]
- (enh) add `after:highlight` plugin API callback (#2395) [Josh Goebel][]
- (enh) split out parse tree generation and HTML rendering concerns (#2404) [Josh Goebel][]
- (enh) every language can have a `name` attribute now (#2400) [Josh Goebel][]
- (enh) improve regular expression detect (less false-positives) (#2380) [Josh Goebel][]
- (enh) make `noHighlightRe` and `languagePrefixRe` configurable (#2374) [Josh Goebel][]

Language Improvements:

- enh(python) Exclude parens from functions params (#2490) [Álvaro Mondéjar][]
- enh(swift) Add `compactMap` to keywords as built_in (#2478) [Omid Golparvar][]
- enh(nim) adds `func` keyword (#2468) [Adnan Yaqoob][]
- enh(xml) deprecate ActionScript inside script tags (#2444) [Josh Goebel][]
- fix(javascript) prevent get/set variables conflicting with keywords (#2440) [Josh Goebel][]
- bug(clojure) Now highlights `defn-` properly (#2438) [Josh Goebel][]
- enh(bash) default value is another variable (#2439) [Josh Goebel][]
- enh(bash) string nested within string (#2439) [Josh Goebel][]
- enh(bash) Add arithmetic expression support (#2439) [Josh Goebel][]
- enh(clojure) Add support for global definitions name (#2347) [Alexandre Grison][]
- enh(fortran) Support Fortran 77 style comments (#2416) [Josh Goebel][]
- (csharp) add support for `@identifier` style identifiers (#2414) [Josh Goebel][]
- fix(elixir) Support function names with a slash (#2406) [Josh Goebel][]
- fix(javascript) comma is allowed in a "value container" (#2403) [Josh Goebel][]
- enh(apache) add `deny` and `allow` keywords [Josh Goebel][]
- enh(apache) highlight numeric attributes values [Josh Goebel][]
- enh(apache) highlight IP addresses, ports, and strings in sections [Josh Goebel][]
- enh(php) added more keywords and include `` functions, highlighted object attributes and
  parsing within template string substitution blocks (`${...}`).
- Fixed another corner case with self-closing `` in JSX.
- Added `HEALTHCHECK` directive in Docker.
- Delphi updated with new Free Pascal keywords.
- Fixed digit separator parsing in C++.
- C# updated with new keywords and fixed to allow multiple identifiers within
  generics `<...>`.
- Fixed another slow regex in Less.


## Version 9.6.0

New languages:

- *ABNF* and *EBNF* by [Alex McKibben][]
- *Awk* by [Matthew Daly][]
- *SubUnit* by [Sergey Bronnikov][]

New styles:

- *Atom One* in both Dark and Light variants  by [Daniel Gamage][]

Plus, a few smaller updates for *Lasso*, *Elixir*, *C++* and *SQL*.

[Alex McKibben]: https://github.com/mckibbenta
[Daniel Gamage]: https://github.com/danielgamage
[Matthew Daly]: https://github.com/matthewbdaly
[Sergey Bronnikov]: https://github.com/ligurio


## Version 9.5.0

New languages:

- *Excel* by [Victor Zhou][]
- *Linden Scripting Language* by [Builder's Brewery][]
- *TAP* (Test Anything Protocol) by [Sergey Bronnikov][]
- *Pony* by [Joe Eli McIlvain][]
- *Coq* by [Stephan Boyer][]
- *dsconfig* and *LDIF* by [Jacob Childress][]

New styles:

- *Ocean Dark* by [Gavin Siu][]

Notable changes:

- [Minh Nguyễn][] added more built-ins to Objective C.
- [Jeremy Hull][] fixed corner cases in C++ preprocessor directives and Diff
  comments.
- [Victor Zhou][] added support for digit separators in C++ numbers.

[Gavin Siu]: https://github.com/gavsiu
[Builder's Brewery]: https://github.com/buildersbrewery
[Victor Zhou]: https://github.com/OiCMudkips
[Sergey Bronnikov]: https://github.com/ligurio
[Joe Eli McIlvain]: https://github.com/jemc
[Stephan Boyer]: https://github.com/boyers
[Jacob Childress]: https://github.com/braveulysses
[Minh Nguyễn]: https://github.com/1ec5
[Jeremy Hull]: https://github.com/sourrust


## Version 9.4.0

New languages:

- *PureBASIC* by [Tristano Ajmone][]
- *BNF* by [Oleg Efimov][]
- *Ada* by [Lars Schulna][]

New styles:

- *PureBASIC* by [Tristano Ajmone][]

Improvements to existing languages and styles:

- We now highlight function declarations in Go.
- [Taisuke Fujimoto][] contributed very convoluted rules for raw and
  interpolated strings in C#.
- [Boone Severson][] updated Verilog to comply with IEEE 1800-2012
  SystemVerilog.
- [Victor Zhou][] improved rules for comments and strings in PowerShell files.
- [Janis Voigtländer][] updated the definition of Elm to version 0.17 of the
  languages. Elm is now featured on the front page of .
- Special variable `$this` is highlighted as a keyword in PHP.
- `usize` and `isize` are now highlighted in Rust.
- Fixed labels and directives in x86 assembler.

[Tristano Ajmone]: https://github.com/tajmone
[Taisuke Fujimoto]: https://github.com/temp-impl
[Oleg Efimov]: https://github.com/Sannis
[Boone Severson]: https://github.com/BooneJS
[Victor Zhou]: https://github.com/OiCMudkips
[Lars Schulna]: https://github.com/captain-hanuta
[Janis Voigtländer]: https://github.com/jvoigtlaender


## Version 9.3.0

New languages:

- *Tagger Script* by [Philipp Wolfer][]
- *MoonScript* by [Billy Quith][]

New styles:

- *xt256* by [Herbert Shin][]

Improvements to existing languages and styles:

- More robust handling of unquoted HTML tag attributes
- Relevance tuning for QML which was unnecessary eager at seizing other
  languages' code
- Improve GAMS language parsing
- Fixed a bunch of bugs around selectors in Less
- Kotlin's got a new definition for annotations, updated keywords and other
  minor improvements
- Added `move` to Rust keywords
- Markdown now recognizes \`\`\`-fenced code blocks
- Improved detection of function declarations in C++ and C#

[Philipp Wolfer]: https://github.com/phw
[Billy Quith]: https://github.com/billyquith
[Herbert Shin]: https://github.com/initbar


## Version 9.2.0

New languages:

- *QML* by [John Foster][]
- *HTMLBars* by [Michael Johnston][]
- *CSP* by [Taras][]
- *Maxima* by [Robert Dodier][]

New styles:

- *Gruvbox* by [Qeole][]
- *Dracula* by [Denis Ciccale][]

Improvements to existing languages and styles:

- We now correctly handle JSX with arbitrary node tree depth.
- Argument list for `(lambda)` in Scheme is no longer highlighted as a function
  call.
- Stylus syntax doesn't break on valid CSS.
- More correct handling of comments and strings and other improvements for
  VimScript.
- More subtle work on the default style.
- We now use anonymous modules for AMD.
- `macro_rules!` is now recognized as a built-in in Rust.

[John Foster]: https://github.com/jf990
[Qeole]: https://github.com/Qeole
[Denis Ciccale]: https://github.com/dciccale
[Michael Johnston]: https://github.com/lastobelus
[Taras]: https://github.com/oxdef
[Robert Dodier]: https://github.com/robert-dodier


## Version 9.1.0

New languages:

- *Stan* by [Brendan Rocks][]
- *BASIC* by [Raphaël Assénat][]
- *GAUSS* by [Matt Evans][]
- *DTS* by [Martin Braun][]
- *Arduino* by [Stefania Mellai][]

New Styles:

- *Arduino Light* by [Stefania Mellai][]

Improvements to existing languages and styles:

- Handle return type annotations in Python
- Allow shebang headers in Javascript
- Support strings in Rust meta
- Recognize `struct` as a class-level definition in Rust
- Recognize b-prefixed chars and strings in Rust
- Better numbers handling in Verilog

[Brendan Rocks]: http://brendanrocks.com
[Raphaël Assénat]: https://github.com/raphnet
[Matt Evans]: https://github.com/matthewevans
[Martin Braun]: https://github.com/mbr0wn
[Stefania Mellai]: https://github.com/smellai


## Version 9.0.0

The new major version brings a reworked styling system. Highlight.js now defines
a limited set of highlightable classes giving a consistent result across all the
styles and languages. You can read a more detailed explanation and background in
the [tracking issue][#348] that started this long process back in May.

This change is backwards incompatible for those who uses highlight.js with a
custom stylesheet. The [new style guide][sg] explains how to write styles
in this new world.

Bundled themes have also suffered a significant amount of improvements and may
look different in places, but all the things now consistent and make more sense.
Among others, the Default style has got a refresh and will probably be tweaked
some more in next releases. Please do give your feedback in our
[issue tracker][issues].

New languages in this release:

- *Caché Object Script* by [Nikita Savchenko][]
- *YAML* by [Stefan Wienert][]
- *MIPS Assembler* by [Nebuleon Fumika][]
- *HSP* by [prince][]

Improvements to existing languages and styles:

- ECMAScript 6 modules import now do not require closing semicolon.
- ECMAScript 6 classes constructors now highlighted.
- Template string support for Typescript, as for ECMAScript 6.
- Scala case classes params highlight fixed.
- Built-in names introduced in Julia v0.4 added by [Kenta Sato][].
- Refreshed Default style.

Other notable changes:

- [Web workers support][webworkers] added bu [Jan Kühle][].
- We now have tests for compressed browser builds as well.
- The building tool chain has been switched to node.js 4.x. and is now
  shamelessly uses ES6 features all over the place, courtesy of [Jeremy Hull][].
- License added to non-compressed browser build.

[Jan Kühle]: https://github.com/frigus02
[Stefan Wienert]: https://github.com/zealot128
[Kenta Sato]: https://github.com/bicycle1885
[Nikita Savchenko]: https://github.com/ZitRos
[webworkers]: https://github.com/isagalaev/highlight.js#web-workers
[Jeremy Hull]: https://github.com/sourrust
[#348]: https://github.com/isagalaev/highlight.js/issues/348
[sg]: http://highlightjs.readthedocs.org/en/latest/style-guide.html
[issues]: https://github.com/isagalaev/highlight.js/issues
[Nebuleon Fumika]: https://github.com/Nebuleon
[prince]: https://github.com/prince-0203


## Version 8.9.1

Some last-minute changes reverted due to strange bug with minified browser build:

- Scala case classes params highlight fixed
- ECMAScript 6 modules import now do not require closing semicolon
- ECMAScript 6 classes constructors now highlighted
- Template string support for Typescript, as for ECMAScript 6
- License added to not minified browser build


## Version 8.9.0

New languages:

- *crmsh* by [Kristoffer Gronlund][]
- *SQF* by [Soren Enevoldsen][]

[Kristoffer Gronlund]: https://github.com/krig
[Soren Enevoldsen]: https://github.com/senevoldsen90

Notable fixes and improvements to existing languages:

- Added `abstract` and `namespace` keywords to TypeScript by [Daniel Rosenwasser][]
- Added `label` support to Dockerfile by [Ladislav Prskavec][]
- Crystal highlighting improved by [Tsuyusato Kitsune][]
- Missing Swift keywords added by [Nate Cook][]
- Improve detection of C block comments
- ~~Scala case classes params highlight fixed~~
- ~~ECMAScript 6 modules import now do not require closing semicolon~~
- ~~ECMAScript 6 classes constructors now highlighted~~
- ~~Template string support for Typescript, as for ECMAScript 6~~

Other notable changes:

- ~~License added to not minified browser build~~

[Kristoffer Gronlund]: https://github.com/krig
[Søren Enevoldsen]: https://github.com/senevoldsen90
[Daniel Rosenwasser]: https://github.com/DanielRosenwasser
[Ladislav Prskavec]: https://github.com/abtris
[Tsuyusato Kitsune]: https://github.com/MakeNowJust
[Nate Cook]: https://github.com/natecook1000


## Version 8.8.0

New languages:

- *Golo* by [Philippe Charrière][]
- *GAMS* by [Stefan Bechert][]
- *IRPF90* by [Anthony Scemama][]
- *Access logs* by [Oleg Efimov][]
- *Crystal* by [Tsuyusato Kitsune][]

Notable fixes and improvements to existing languages:

- JavaScript highlighting no longer fails with ES6 default parameters
- Added keywords `async` and `await` to Python
- PHP heredoc support improved
- Allow preprocessor directives within C++ functions

Other notable changes:

- Change versions to X.Y.Z SemVer-compatible format
- Added ability to build all targets at once

[Philippe Charrière]: https://github.com/k33g
[Stefan Bechert]: https://github.com/b-pos465
[Anthony Scemama]: https://github.com/scemama
[Oleg Efimov]: https://github.com/Sannis
[Tsuyusato Kitsune]: https://github.com/MakeNowJust


## Version 8.7

New languages:

- *Zephir* by [Oleg Efimov][]
- *Elm* by [Janis Voigtländer][]
- *XQuery* by [Dirk Kirsten][]
- *Mojolicious* by [Dotan Dimet][]
- *AutoIt* by Manh Tuan from [J2TeaM][]
- *Toml* (ini extension) by [Guillaume Gomez][]

New styles:

- *Hopscotch* by [Jan T. Sott][]
- *Grayscale* by [MY Sun][]

Notable fixes and improvements to existing languages:

- Fix encoding of images when copied over in certain builds
- Fix incorrect highlighting of the word "bug" in comments
- Treat decorators different from matrix multiplication in Python
- Fix traits inheritance highlighting in Rust
- Fix incorrect document
- Oracle keywords added to SQL language definition by [Vadimtro][]
- Postgres keywords added to SQL language definition by [Benjamin Auder][]
- Fix registers in x86asm being highlighted as a hex number
- Fix highlighting for numbers with a leading decimal point
- Correctly highlight numbers and strings inside of C/C++ macros
- C/C++ functions now support pointer, reference, and move returns

[Oleg Efimov]: https://github.com/Sannis
[Guillaume Gomez]: https://github.com/GuillaumeGomez
[Janis Voigtländer]: https://github.com/jvoigtlaender
[Jan T. Sott]: https://github.com/idleberg
[Dirk Kirsten]: https://github.com/dirkk
[MY Sun]: https://github.com/simonmysun
[Vadimtro]: https://github.com/Vadimtro
[Benjamin Auder]: https://github.com/ghost
[Dotan Dimet]: https://github.com/dotandimet
[J2TeaM]: https://github.com/J2TeaM


## Version 8.6

New languages:

- *C/AL* by [Kenneth Fuglsang][]
- *DNS zone file* by [Tim Schumacher][]
- *Ceylon* by [Lucas Werkmeister][]
- *OpenSCAD* by [Dan Panzarella][]
- *Inform7* by [Bruno Dias][]
- *armasm* by [Dan Panzarella][]
- *TP* by [Jay Strybis][]

New styles:

- *Atelier Cave*, *Atelier Estuary*,
  *Atelier Plateau* and *Atelier Savanna* by [Bram de Haan][]
- *Github Gist* by [Louis Barranqueiro][]

Notable fixes and improvements to existing languages:

- Multi-line raw strings from C++11 are now supported
- Fix class names with dashes in HAML
- The `async` keyword from ES6/7 is now supported
- TypeScript functions handle type and parameter complexity better
- We unified phpdoc/javadoc/yardoc etc modes across all languages
- CSS .class selectors relevance was dropped to prevent wrong language detection
- Images is now included to CDN build
- Release process is now automated

[Bram de Haan]: https://github.com/atelierbram
[Kenneth Fuglsang]: https://github.com/kfuglsang
[Louis Barranqueiro]: https://github.com/LouisBarranqueiro
[Tim Schumacher]: https://github.com/enko
[Lucas Werkmeister]: https://github.com/lucaswerkmeister
[Dan Panzarella]: https://github.com/pzl
[Bruno Dias]: https://github.com/sequitur
[Jay Strybis]: https://github.com/unreal


## Version 8.5

New languages:

- *pf.conf* by [Peter Piwowarski][]
- *Julia* by [Kenta Sato][]
- *Prolog* by [Raivo Laanemets][]
- *Docker* by [Alexis Hénaut][]
- *Fortran* by [Anthony Scemama][] and [Thomas Applencourt][]
- *Kotlin* by [Sergey Mashkov][]

New styles:

- *Agate* by [Taufik Nurrohman][]
- *Darcula* by [JetBrains][]
- *Atelier Sulphurpool* by [Bram de Haan][]
- *Android Studio* by [Pedro Oliveira][]

Notable fixes and improvements to existing languages:

- ES6 features in JavaScript are better supported now by [Gu Yiling][].
- Swift now recognizes body-less method definitions.
- Single expression functions `def foo, do: ... ` now work in Elixir.
- More uniform detection of built-in classes in Objective C.
- Fixes for number literals and processor directives in Rust.
- HTML `
  ```

- `tabReplace` and `useBR` that were used in different places are also unified
  into the global options object and are to be set using `configure(options)`.
  This function is documented in our [API docs][]. Also note that these
  parameters are gone from `highlightBlock` and `fixMarkup` which are now also
  rely on `configure`.

- We removed public-facing (though undocumented) object `hljs.LANGUAGES` which
  was used to register languages with the library in favor of two new methods:
  `registerLanguage` and `getLanguage`. Both are documented in our [API docs][].

- Result returned from `highlight` and `highlightAuto` no longer contains two
  separate attributes contributing to relevance score, `relevance` and
  `keyword_count`. They are now unified in `relevance`.

Another technically compatible change that nonetheless might need attention:

- The structure of the NPM package was refactored, so if you had installed it
  locally, you'll have to update your paths. The usual `require('highlight.js')`
  works as before. This is contributed by [Dmitry Smolin][].

New features:

- Languages now can be recognized by multiple names like "js" for JavaScript or
  "html" for, well, HTML (which earlier insisted on calling it "xml"). These
  aliases can be specified in the class attribute of the code container in your
  HTML as well as in various API calls. For now there are only a few very common
  aliases but we'll expand it in the future. All of them are listed in the
  [class reference][cr].

- Language detection can now be restricted to a subset of languages relevant in
  a given context — a web page or even a single highlighting call. This is
  especially useful for node.js build that includes all the known languages.
  Another example is a StackOverflow-style site where users specify languages
  as tags rather than in the markdown-formatted code snippets. This is
  documented in the [API reference][] (see methods `highlightAuto` and
  `configure`).

- Language definition syntax streamlined with [variants][] and
  [beginKeywords][].

New languages and styles:

- *Oxygene* by [Carlo Kok][]
- *Mathematica* by [Daniel Kvasnička][]
- *Autohotkey* by [Seongwon Lee][]
- *Atelier* family of styles in 10 variants by [Bram de Haan][]
- *Paraíso* styles by [Jan T. Sott][]

Miscellaneous improvements:

- Highlighting `=>` prompts in Clojure.
- [Jeremy Hull][] fixed a lot of styles for consistency.
- Finally, highlighting PHP and HTML [mixed in peculiar ways][php-html].
- Objective C and C# now properly highlight titles in method definition.
- Big overhaul of relevance counting for a number of languages. Please do report
  bugs about mis-detection of non-trivial code snippets!

[API reference]: http://highlightjs.readthedocs.org/en/latest/api.html

[cr]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html
[api docs]: http://highlightjs.readthedocs.org/en/latest/api.html
[variants]: https://groups.google.com/d/topic/highlightjs/VoGC9-1p5vk/discussion
[beginKeywords]: https://github.com/isagalaev/highlight.js/commit/6c7fdea002eb3949577a85b3f7930137c7c3038d
[php-html]: https://twitter.com/highlightjs/status/408890903017689088

[Carlo Kok]: https://github.com/carlokok
[Bram de Haan]: https://github.com/atelierbram
[Daniel Kvasnička]: https://github.com/dkvasnicka
[Dmitry Smolin]: https://github.com/dimsmol
[Jeremy Hull]: https://github.com/sourrust
[Seongwon Lee]: https://github.com/dlimpid
[Jan T. Sott]: https://github.com/idleberg


## Version 7.5

A catch-up release dealing with some of the accumulated contributions. This one
is probably will be the last before the 8.0 which will be slightly backwards
incompatible regarding some advanced use-cases.

One outstanding change in this version is the addition of 6 languages to the
[hosted script][d]: Markdown, ObjectiveC, CoffeeScript, Apache, Nginx and
Makefile. It now weighs about 6K more but we're going to keep it under 30K.

New languages:

- OCaml by [Mehdi Dogguy][mehdid] and [Nicolas Braud-Santoni][nbraud]
- [LiveCode Server][lcs] by [Ralf Bitter][revig]
- Scilab by [Sylvestre Ledru][sylvestre]
- basic support for Makefile by [Ivan Sagalaev][isagalaev]

Improvements:

- Ruby's got support for characters like `?A`, `?1`, `?\012` etc. and `%r{..}`
  regexps.
- Clojure now allows a function call in the beginning of s-expressions
  `(($filter "myCount") (arr 1 2 3 4 5))`.
- Haskell's got new keywords and now recognizes more things like pragmas,
  preprocessors, modules, containers, FFIs etc. Thanks to [Zena Treep][treep]
  for the implementation and to [Jeremy Hull][sourrust] for guiding it.
- Miscellaneous fixes in PHP, Brainfuck, SCSS, Asciidoc, CMake, Python and F#.

[mehdid]: https://github.com/mehdid
[nbraud]: https://github.com/nbraud
[revig]: https://github.com/revig
[lcs]: http://livecode.com/developers/guides/server/
[sylvestre]: https://github.com/sylvestre
[isagalaev]: https://github.com/isagalaev
[treep]: https://github.com/treep
[sourrust]: https://github.com/sourrust
[d]: http://highlightjs.org/download/


## New core developers

The latest long period of almost complete inactivity in the project coincided
with growing interest to it led to a decision that now seems completely obvious:
we need more core developers.

So without further ado let me welcome to the core team two long-time
contributors: [Jeremy Hull][] and [Oleg
Efimov][].

Hope now we'll be able to work through stuff faster!

P.S. The historical commit is [here][1] for the record.

[Jeremy Hull]: https://github.com/sourrust
[Oleg Efimov]: https://github.com/sannis
[1]: https://github.com/isagalaev/highlight.js/commit/f3056941bda56d2b72276b97bc0dd5f230f2473f


## Version 7.4

This long overdue version is a snapshot of the current source tree with all the
changes that happened during the past year. Sorry for taking so long!

Along with the changes in code highlight.js has finally got its new home at
, moving from its cradle on Software Maniacs which it
outgrew a long time ago. Be sure to report any bugs about the site to
.

On to what's new…

New languages:

- Handlebars templates by [Robin Ward][]
- Oracle Rules Language by [Jason Jacobson][]
- F# by [Joans Follesø][]
- AsciiDoc and Haml by [Dan Allen][]
- Lasso by [Eric Knibbe][]
- SCSS by [Kurt Emch][]
- VB.NET by [Poren Chiang][]
- Mizar by [Kelley van Evert][]

[Robin Ward]: https://github.com/eviltrout
[Jason Jacobson]: https://github.com/jayce7
[Joans Follesø]: https://github.com/follesoe
[Dan Allen]: https://github.com/mojavelinux
[Eric Knibbe]: https://github.com/EricFromCanada
[Kurt Emch]: https://github.com/kemch
[Poren Chiang]: https://github.com/rschiang
[Kelley van Evert]: https://github.com/kelleyvanevert

New style themes:

- Monokai Sublime by [noformnocontent][]
- Railscasts by [Damien White][]
- Obsidian by [Alexander Marenin][]
- Docco by [Simon Madine][]
- Mono Blue by [Ivan Sagalaev][] (uses a single color hue for everything)
- Foundation by [Dan Allen][]

[noformnocontent]: http://nn.mit-license.org/
[Damien White]: https://github.com/visoft
[Alexander Marenin]: https://github.com/ioncreature
[Simon Madine]: https://github.com/thingsinjars
[Ivan Sagalaev]: https://github.com/isagalaev

Other notable changes:

- Corrected many corner cases in CSS.
- Dropped Python 2 version of the build tool.
- Implemented building for the AMD format.
- Updated Rust keywords (thanks to [Dmitry Medvinsky][]).
- Literal regexes can now be used in language definitions.
- CoffeeScript highlighting is now significantly more robust and rich due to
  input from [Cédric Néhémie][].

[Dmitry Medvinsky]: https://github.com/dmedvinsky
[Cédric Néhémie]: https://github.com/abe33


## Version 7.3

- Since this version highlight.js no longer works in IE version 8 and older.
  It's made it possible to reduce the library size and dramatically improve code
  readability and made it easier to maintain. Time to go forward!

- New languages: AppleScript (by [Nathan Grigg][ng] and [Dr. Drang][dd]) and
  Brainfuck (by [Evgeny Stepanischev][bolk]).

- Improvements to existing languages:

    - interpreter prompt in Python (`>>>` and `...`)
    - @-properties and classes in CoffeeScript
    - E4X in JavaScript (by [Oleg Efimov][oe])
    - new keywords in Perl (by [Kirk Kimmel][kk])
    - big Ruby syntax update (by [Vasily Polovnyov][vast])
    - small fixes in Bash

- Also Oleg Efimov did a great job of moving all the docs for language and style
  developers and contributors from the old wiki under the source code in the
  "docs" directory. Now these docs are nicely presented at
  .

[ng]: https://github.com/nathan11g
[dd]: https://github.com/drdrang
[bolk]: https://github.com/bolknote
[oe]: https://github.com/Sannis
[kk]: https://github.com/kimmel
[vast]: https://github.com/vast


## Version 7.2

A regular bug-fix release without any significant new features. Enjoy!


## Version 7.1

A Summer crop:

- [Marc Fornos][mf] made the definition for Clojure along with the matching
  style Rainbow (which, of course, works for other languages too).
- CoffeeScript support continues to improve getting support for regular
  expressions.
- Yoshihide Jimbo ported to highlight.js [five Tomorrow styles][tm] from the
  [project by Chris Kempson][tm0].
- Thanks to [Casey Duncun][cd] the library can now be built in the popular
  [AMD format][amd].
- And last but not least, we've got a fair number of correctness and consistency
  fixes, including a pretty significant refactoring of Ruby.

[mf]: https://github.com/mfornos
[tm]: http://jmblog.github.com/color-themes-for-highlightjs/
[tm0]: https://github.com/ChrisKempson/Tomorrow-Theme
[cd]: https://github.com/caseman
[amd]: http://requirejs.org/docs/whyamd.html


## Version 7.0

The reason for the new major version update is a global change of keyword syntax
which resulted in the library getting smaller once again. For example, the
hosted build is 2K less than at the previous version while supporting two new
languages.

Notable changes:

- The library now works not only in a browser but also with [node.js][]. It is
  installable with `npm install highlight.js`. [API][] docs are available on our
  wiki.

- The new unique feature (apparently) among syntax highlighters is highlighting
  *HTTP* headers and an arbitrary language in the request body. The most useful
  languages here are *XML* and *JSON* both of which highlight.js does support.
  Here's [the detailed post][p] about the feature.

- Two new style themes: a dark "south" *[Pojoaque][]* by Jason Tate and an
  emulation of*XCode* IDE by [Angel Olloqui][ao].

- Three new languages: *D* by [Aleksandar Ružičić][ar], *R* by [Joe Cheng][jc]
  and *GLSL* by [Sergey Tikhomirov][st].

- *Nginx* syntax has become a million times smaller and more universal thanks to
  remaking it in a more generic manner that doesn't require listing all the
  directives in the known universe.

- Function titles are now highlighted in *PHP*.

- *Haskell* and *VHDL* were significantly reworked to be more rich and correct
  by their respective maintainers [Jeremy Hull][sr] and [Igor Kalnitsky][ik].

And last but not least, many bugs have been fixed around correctness and
language detection.

Overall highlight.js currently supports 51 languages and 20 style themes.

[node.js]: http://nodejs.org/
[api]: http://softwaremaniacs.org/wiki/doku.php/highlight.js:api
[p]: http://softwaremaniacs.org/blog/2012/05/10/http-and-json-in-highlight-js/en/
[pojoaque]: http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html
[ao]: https://github.com/angelolloqui
[ar]: https://github.com/raleksandar
[jc]: https://github.com/jcheng5
[st]: https://github.com/tikhomirov
[sr]: https://github.com/sourrust
[ik]: https://github.com/ikalnitsky


## Version 6.2

A lot of things happened in highlight.js since the last version! We've got nine
new contributors, the discussion group came alive, and the main branch on GitHub
now counts more than 350 followers. Here are most significant results coming
from all this activity:

- 5 (five!) new languages: Rust, ActionScript, CoffeeScript, MatLab and
  experimental support for markdown. Thanks go to [Andrey Vlasovskikh][av],
  [Alexander Myadzel][am], [Dmytrii Nagirniak][dn], [Oleg Efimov][oe], [Denis
  Bardadym][db] and [John Crepezzi][jc].

- 2 new style themes: Monokai by [Luigi Maselli][lm] and stylistic imitation of
  another well-known highlighter Google Code Prettify by [Aahan Krish][ak].

- A vast number of [correctness fixes and code refactorings][log], mostly made
  by [Oleg Efimov][oe] and [Evgeny Stepanischev][es].

[av]: https://github.com/vlasovskikh
[am]: https://github.com/myadzel
[dn]: https://github.com/dnagir
[oe]: https://github.com/Sannis
[db]: https://github.com/btd
[jc]: https://github.com/seejohnrun
[lm]: http://grigio.org/
[ak]: https://github.com/geekpanth3r
[es]: https://github.com/bolknote
[log]: https://github.com/isagalaev/highlight.js/commits/


## Version 6.1 — Solarized

[Jeremy Hull][jh] has implemented my dream feature — a port of [Solarized][]
style theme famous for being based on the intricate color theory to achieve
correct contrast and color perception. It is now available for highlight.js in
both variants — light and dark.

This version also adds a new original style Arta. Its author pumbur maintains a
[heavily modified fork of highlight.js][pb] on GitHub.

[jh]: https://github.com/sourrust
[solarized]: http://ethanschoonover.com/solarized
[pb]: https://github.com/pumbur/highlight.js


## Version 6.0

New major version of the highlighter has been built on a significantly
refactored syntax. Due to this it's even smaller than the previous one while
supporting more languages!

New languages are:

- Haskell by [Jeremy Hull][sourrust]
- Erlang in two varieties — module and REPL — made collectively by [Nikolay
  Zakharov][desh], [Dmitry Kovega][arhibot] and [Sergey Ignatov][ignatov]
- Objective C by [Valerii Hiora][vhbit]
- Vala by [Antono Vasiljev][antono]
- Go by [Stephan Kountso][steplg]

[sourrust]: https://github.com/sourrust
[desh]: http://desh.su/
[arhibot]: https://github.com/arhibot
[ignatov]: https://github.com/ignatov
[vhbit]: https://github.com/vhbit
[antono]: https://github.com/antono
[steplg]: https://github.com/steplg

Also this version is marginally faster and fixes a number of small long-standing
bugs.

Developer overview of the new language syntax is available in a [blog post about
recent beta release][beta].

[beta]: http://softwaremaniacs.org/blog/2011/04/25/highlight-js-60-beta/en/

P.S. New version is not yet available on a Yandex CDN, so for now you have to
download [your own copy][d].

[d]: /soft/highlight/en/download/


## Version 5.14

Fixed bugs in HTML/XML detection and relevance introduced in previous
refactoring.

Also test.html now shows the second best result of language detection by
relevance.


## Version 5.13

Past weekend began with a couple of simple additions for existing languages but
ended up in a big code refactoring bringing along nice improvements for language
developers.

### For users

- Description of C++ has got new keywords from the upcoming [C++ 0x][] standard.
- Description of HTML has got new tags from [HTML 5][].
- CSS-styles have been unified to use consistent padding and also have lost
  pop-outs with names of detected languages.
- [Igor Kalnitsky][ik] has sent two new language descriptions: CMake & VHDL.

This makes total number of languages supported by highlight.js to reach 35.

Bug fixes:

- Custom classes on `
` tags are not being overridden anymore
- More correct highlighting of code blocks inside non-`
` containers:
  highlighter now doesn't insist on replacing them with its own container and
  just replaces the contents.
- Small fixes in browser compatibility and heuristics.

[c++ 0x]: http://ru.wikipedia.org/wiki/C%2B%2B0x
[html 5]: http://en.wikipedia.org/wiki/HTML5
[ik]: http://kalnitsky.org.ua/

### For developers

The most significant change is the ability to include language submodes right
under `contains` instead of defining explicit named submodes in the main array:

    contains: [
      'string',
      'number',
      {begin: '\\n', end: hljs.IMMEDIATE_RE}
    ]

This is useful for auxiliary modes needed only in one place to define parsing.
Note that such modes often don't have `className` and hence won't generate a
separate `` in the resulting markup. This is similar in effect to
`noMarkup: true`. All existing languages have been refactored accordingly.

Test file test.html has at last become a real test. Now it not only puts the
detected language name under the code snippet but also tests if it matches the
expected one. Test summary is displayed right above all language snippets.


## CDN

Fine people at [Yandex][] agreed to host highlight.js on their big fast servers.
[Link up][l]!

[yandex]: http://yandex.com/
[l]: http://softwaremaniacs.org/soft/highlight/en/download/


## Version 5.10 — "Paris".

Though I'm on a vacation in Paris, I decided to release a new version with a
couple of small fixes:

- Tomas Vitvar discovered that TAB replacement doesn't always work when used
  with custom markup in code
- SQL parsing is even more rigid now and doesn't step over SmallTalk in tests


## Version 5.9

A long-awaited version is finally released.

New languages:

- Andrew Fedorov made a definition for Lua
- a long-time highlight.js contributor [Peter Leonov][pl] made a definition for
  Nginx config
- [Vladimir Moskva][vm] made a definition for TeX

[pl]: http://kung-fu-tzu.ru/
[vm]: http://fulc.ru/

Fixes for existing languages:

- [Loren Segal][ls] reworked the Ruby definition and added highlighting for
  [YARD][] inline documentation
- the definition of SQL has become more solid and now it shouldn't be overly
  greedy when it comes to language detection

[ls]: http://gnuu.org/
[yard]: http://yardoc.org/

The highlighter has become more usable as a library allowing to do highlighting
from initialization code of JS frameworks and in ajax methods (see.
readme.eng.txt).

Also this version drops support for the [WordPress][wp] plugin. Everyone is
welcome to [pick up its maintenance][p] if needed.

[wp]: http://wordpress.org/
[p]: http://bazaar.launchpad.net/~isagalaev/+junk/highlight/annotate/342/src/wp_highlight.js.php


## Version 5.8

- Jan Berkel has contributed a definition for Scala. +1 to hotness!
- All CSS-styles are rewritten to work only inside `
` tags to avoid
  conflicts with host site styles.


## Version 5.7.

Fixed escaping of quotes in VBScript strings.


## Version 5.5

This version brings a small change: now .ini-files allow digits, underscores and
square brackets in key names.


## Version 5.4

Fixed small but upsetting bug in the packer which caused incorrect highlighting
of explicitly specified languages. Thanks to Andrew Fedorov for precise
diagnostics!


## Version 5.3

The version to fulfil old promises.

The most significant change is that highlight.js now preserves custom user
markup in code along with its own highlighting markup. This means that now it's
possible to use, say, links in code. Thanks to [Vladimir Dolzhenko][vd] for the
[initial proposal][1] and for making a proof-of-concept patch.

Also in this version:

- [Vasily Polovnyov][vp] has sent a GitHub-like style and has implemented
  support for CSS @-rules and Ruby symbols.
- Yura Zaripov has sent two styles: Brown Paper and School Book.
- Oleg Volchkov has sent a definition for [Parser 3][p3].

[1]: http://softwaremaniacs.org/forum/highlightjs/6612/
[p3]: http://www.parser.ru/
[vp]: http://vasily.polovnyov.ru/
[vd]: http://dolzhenko.blogspot.com/


## Version 5.2

- at last it's possible to replace indentation TABs with something sensible
  (e.g. 2 or 4 spaces)
- new keywords and built-ins for 1C by Sergey Baranov
- a couple of small fixes to Apache highlighting


## Version 5.1

This is one of those nice version consisting entirely of new and shiny
contributions!

- [Vladimir Ermakov][vooon] created highlighting for AVR Assembler
- [Ruslan Keba][rukeba] created highlighting for Apache config file. Also his
  original visual style for it is now available for all highlight.js languages
  under the name "Magula".
- [Shuen-Huei Guan][drake] (aka Drake) sent new keywords for RenderMan
  languages. Also thanks go to [Konstantin Evdokimenko][ke] for his advice on
  the matter.

[vooon]: http://vehq.ru/about/
[rukeba]: http://rukeba.com/
[drake]: http://drakeguan.org/
[ke]: http://k-evdokimenko.moikrug.ru/


## Version 5.0

The main change in the new major version of highlight.js is a mechanism for
packing several languages along with the library itself into a single compressed
file. Now sites using several languages will load considerably faster because
the library won't dynamically include additional files while loading.

Also this version fixes a long-standing bug with Javascript highlighting that
couldn't distinguish between regular expressions and division operations.

And as usually there were a couple of minor correctness fixes.

Great thanks to all contributors! Keep using highlight.js.


## Version 4.3

This version comes with two contributions from [Jason Diamond][jd]:

- language definition for C# (yes! it was a long-missed thing!)
- Visual Studio-like highlighting style

Plus there are a couple of minor bug fixes for parsing HTML and XML attributes.

[jd]: http://jason.diamond.name/weblog/


## Version 4.2

The biggest news is highlighting for Lisp, courtesy of Vasily Polovnyov. It's
somewhat experimental meaning that for highlighting "keywords" it doesn't use
any pre-defined set of a Lisp dialect. Instead it tries to highlight first word
in parentheses wherever it makes sense. I'd like to ask people programming in
Lisp to confirm if it's a good idea and send feedback to [the forum][f].

Other changes:

- Smalltalk was excluded from DEFAULT_LANGUAGES to save traffic
- [Vladimir Epifanov][voldmar] has implemented javascript style switcher for
  test.html
- comments now allowed inside Ruby function definition
- [MEL][] language from [Shuen-Huei Guan][drake]
- whitespace now allowed between `
` and ``
- better auto-detection of C++ and PHP
- HTML allows embedded VBScript (`<% .. %>`)

[f]: http://softwaremaniacs.org/forum/highlightjs/
[voldmar]: http://voldmar.ya.ru/
[mel]: http://en.wikipedia.org/wiki/Maya_Embedded_Language
[drake]: http://drakeguan.org/


## Version 4.1

Languages:

- Bash from Vah
- DOS bat-files from Alexander Makarov (Sam)
- Diff files from Vasily Polovnyov
- Ini files from myself though initial idea was from Sam

Styles:

- Zenburn from Vladimir Epifanov, this is an imitation of a
  [well-known theme for Vim][zenburn].
- Ascetic from myself, as a realization of ideals of non-flashy highlighting:
  just one color in only three gradations :-)

In other news. [One small bug][bug] was fixed, built-in keywords were added for
Python and C++ which improved auto-detection for the latter (it was shame that
[my wife's blog][alenacpp] had issues with it from time to time). And lastly
thanks go to Sam for getting rid of my stylistic comments in code that were
getting in the way of [JSMin][].

[zenburn]: http://en.wikipedia.org/wiki/Zenburn
[alenacpp]: http://alenacpp.blogspot.com/
[bug]: http://softwaremaniacs.org/forum/viewtopic.php?id=1823
[jsmin]: http://code.google.com/p/jsmin-php/


## Version 4.0

New major version is a result of vast refactoring and of many contributions.

Visible new features:

- Highlighting of embedded languages. Currently is implemented highlighting of
  Javascript and CSS inside HTML.
- Bundled 5 ready-made style themes!

Invisible new features:

- Highlight.js no longer pollutes global namespace. Only one object and one
  function for backward compatibility.
- Performance is further increased by about 15%.

Changing of a major version number caused by a new format of language definition
files. If you use some third-party language files they should be updated.


## Version 3.5

A very nice version in my opinion fixing a number of small bugs and slightly
increased speed in a couple of corner cases. Thanks to everybody who reports
bugs in he [forum][f] and by email!

There is also a new language — XML. A custom XML formerly was detected as HTML
and didn't highlight custom tags. In this version I tried to make custom XML to
be detected and highlighted by its own rules. Which by the way include such
things as CDATA sections and processing instructions (``).

[f]: http://softwaremaniacs.org/forum/viewforum.php?id=6


## Version 3.3

[Vladimir Gubarkov][xonix] has provided an interesting and useful addition.
File export.html contains a little program that shows and allows to copy and
paste an HTML code generated by the highlighter for any code snippet. This can
be useful in situations when one can't use the script itself on a site.


[xonix]: http://xonixx.blogspot.com/


## Version 3.2 consists completely of contributions:

- Vladimir Gubarkov has described SmallTalk
- Yuri Ivanov has described 1C
- Peter Leonov has packaged the highlighter as a Firefox extension
- Vladimir Ermakov has compiled a mod for phpBB

Many thanks to you all!


## Version 3.1

Three new languages are available: Django templates, SQL and Axapta. The latter
two are sent by [Dmitri Roudakov][1]. However I've almost entirely rewrote an
SQL definition but I'd never started it be it from the ground up :-)

The engine itself has got a long awaited feature of grouping keywords
("keyword", "built-in function", "literal"). No more hacks!

[1]: http://roudakov.ru/


## Version 3.0

It is major mainly because now highlight.js has grown large and has become
modular. Now when you pass it a list of languages to highlight it will
dynamically load into a browser only those languages.

Also:

- Konstantin Evdokimenko of [RibKit][] project has created a highlighting for
  RenderMan Shading Language and RenderMan Interface Bytestream. Yay for more
  languages!
- Heuristics for C++ and HTML got better.
- I've implemented (at last) a correct handling of backslash escapes in C-like
  languages.

There is also a small backwards incompatible change in the new version. The
function initHighlighting that was used to initialize highlighting instead of
initHighlightingOnLoad a long time ago no longer works. If you by chance still
use it — replace it with the new one.

[RibKit]: http://ribkit.sourceforge.net/


## Version 2.9

Highlight.js is a parser, not just a couple of regular expressions. That said
I'm glad to announce that in the new version 2.9 has support for:

- in-string substitutions for Ruby -- `#{...}`
- strings from from numeric symbol codes (like #XX) for Delphi


## Version 2.8

A maintenance release with more tuned heuristics. Fully backwards compatible.


## Version 2.7

- Nikita Ledyaev presents highlighting for VBScript, yay!
- A couple of bugs with escaping in strings were fixed thanks to Mickle
- Ongoing tuning of heuristics

Fixed bugs were rather unpleasant so I encourage everyone to upgrade!


## Version 2.4

- Peter Leonov provides another improved highlighting for Perl
- Javascript gets a new kind of keywords — "literals". These are the words
  "true", "false" and "null"

Also highlight.js homepage now lists sites that use the library. Feel free to
add your site by [dropping me a message][mail] until I find the time to build a
submit form.

[mail]: mailto:Maniac@SoftwareManiacs.Org


## Version 2.3

This version fixes IE breakage in previous version. My apologies to all who have
already downloaded that one!


## Version 2.2

- added highlighting for Javascript
- at last fixed parsing of Delphi's escaped apostrophes in strings
- in Ruby fixed highlighting of keywords 'def' and 'class', same for 'sub' in
  Perl


## Version 2.0

- Ruby support by [Anton Kovalyov][ak]
- speed increased by orders of magnitude due to new way of parsing
- this same way allows now correct highlighting of keywords in some tricky
  places (like keyword "End" at the end of Delphi classes)

[ak]: http://anton.kovalyov.net/


## Version 1.0

Version 1.0 of javascript syntax highlighter is released!

It's the first version available with English description. Feel free to post
your comments and question to [highlight.js forum][forum]. And don't be afraid
if you find there some fancy Cyrillic letters -- it's for Russian users too :-)

[forum]: http://softwaremaniacs.org/forum/viewforum.php?id=6


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

[![discord](https://badgen.net/badge/icon/discord?icon=discord&label&color=pink)](https://discord.gg/M24EbU7ja9)
[![open issues](https://badgen.net/github/open-issues/highlightjs/highlight.js?label=issues)](https://github.com/highlightjs/highlight.js/issues)
[![help welcome issues](https://badgen.net/github/label-issues/highlightjs/highlight.js/help%20welcome/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+welcome%22)
[![good first issue](https://badgen.net/github/label-issues/highlightjs/highlight.js/good%20first%20issue/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen%20is%3Aissue%20label%3A%22good%20first%20issue%22)

**Contents**

- [Welcome](#welcome)
  - [Our Philosophy](#our-philosophy)
  - [Prerequisites](#prerequisites)
- [Requesting Features](#requesting-features)
  - [Language Requests](#language-requests)
- [Reporting Issues](#reporting-issues)
- [Fixing Issues (PRs)](#fixing-issues-prs)
  - [In a nutshell](#in-a-nutshell)
  - [Build and Test](#build-and-test)


## Welcome

Hello and welcome to Highlight.js. We're a code-highlighting engine, but you probably knew that already. If you are considering contributing to Highlight.js this document will be hopefully be a helpful resource.

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

**You do not have to be a programmer.** There are many ways to contribute::

- Hang out on our [Discord](https://discord.gg/M24EbU7ja9) and help answers questions as they come up
- Report [new issues or bugs](https://github.com/highlightjs/highlight.js/issues/new/choose) or join the existing discussion on open issues
- Submit pull requests to resolve issues
- Write [plugins](https://highlightjs.readthedocs.io/en/latest/plugin-api.html) that extend our core functionality
- Author [language definitions](https://github.com/highlightjs/highlight.js/blob/master/extra/3RD_PARTY_QUICK_START.md) to improve our language support
- Design [new themes](https://highlightjs.readthedocs.io/en/latest/theme-guide.html) to make our highlighting extra beautiful
- Improve our documentation to better explain all the things to all the peoples

### Our Philosophy

Highlight.js makes an effort to keep the core engine small, simple, and easy to use.  Our goal with core is to support the highlighting "happy path" and let plug-ins handle edge cases.

- Rather than add lots of tiny features and configuration knobs we [embrace plug-ins and extensions](https://github.com/highlightjs/highlight.js/issues/2225). For example, our [lack of line numbers is considered a feature](https://highlightjs.readthedocs.io/en/latest/line-numbers.html).
- We do quite bit more than highlight keywords. We often make an attempt to understand local context, yet we do not strive to be a full and correct parser for any language.
- Our [language auto-detection is unfortunately not magic](https://github.com/highlightjs/highlight.js/issues/1213). It's best effort, not best in class. If you think you could help improve it that'd be a great contribution!

### Prerequisites

- To help answer questions on issues or contribute on Discord you need only be friendly.
- To contribute to language definitions knowing [Regular Expressions](https://www.regular-expressions.info) is often necessary.
- To work on the core parsing engine you'll need to know JavaScript.
- To work on documentation you need to be ready and willing to document things.
- Attention to detail or expert knowledge in one of the languages we highlight can be super helpful.


## Requesting Features

Feature requests are always welcome.  If the feature doesn't belong in the core library then we're always happy to suggest how you might go about developing a plug-in.

If you're thinking of contributing a feature first open an issue to discuss whether the feature belongs in core vs a plug-in.  Often this is a great way to get implementation tips or links to prior discussions on the topic often with additional context, etc.


### Language Requests

If you wish we supported a language we don't, first read [On requesting new languages](https://highlightjs.readthedocs.io/en/latest/language-requests.html).  TL;DR The core team generally doesn't implement new languages - so there is no point opening requests.  Please consider trying to contribute the language yourself or enlisting the help of a friend.


## Reporting Issues

If you find a bug or think of an improvement, feel free to [open an issue](https://github.com/highlightjs/highlight.js/issues/new/choose).
- If you've found a language highlighting issue, you can use [this JSFiddle](https://jsfiddle.net/ajoshguy/cjhvre2k/) to create a test case.


## Fixing Issues (PRs)


If you feel comfortable with the [prerequisites](#prerequisites), you can grab any issue marked ["good first issue"](https://github.com/highlightjs/highlight.js/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). Or feel free to jump in with thoughts or comments on any of the more complex issues.

### In a nutshell

If you're new to contributing to open-source, have a look at [this GitHub Guide](https://guides.github.com/activities/forking). It explains the general process of GitHub collaboration.

Highlight.js is developed in JavaScript, so you'll need the usual suspects: [Node.js](https://nodejs.dev/download/), npm (or yarn), git, etc.  You'll likely start by forking the repository on GitHub and then cloning it locally.

1. Fork this project on GitHub.
2. Clone it locally `git clone git@github.com:username/highlight.js.git`.
3. Create a work branch (`git checkout -b my-branch`).
4. Commit your changes (`git commit -m 'my changes'`).
5. [Build and Test](#build-and-test)
6. Push the branch (`git push origin my-branch`).
7. Open a Pull Request from your fork back to this repository.


### Keep in Mind 

Please open a new issue before your PR (or join the discussion on the existing issue), so we can explore and discuss the topic at hand. Your time is important, and we need to be sure it's well-spent.

*Before* you start coding, keep these tips in mind:

- You should usually add markup tests (ie. whenever you've made a significant grammar change or fixed a bug). Simply adding `keywords` can be an exception to this rule.
- Change only what needs to be changed; don't re-lint or rewrite whole files when fixing small bugs
- Linting or major re-organization needs a dedicated commit

*After* you make your changes, we have some housekeeping tasks for you - like updating the [changelog](https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md). The PR template will be your guide.


### Build and Test

When contributing a PR (that doesn't make any specific changes to browser features) it's usually sufficient to build and test only the Node.js build.  Our CI process will guarantee that the browser build is still green.

Testing the Node.js build:

```console
npm run build
npm run test
```

The browser library is built and tested separately:

```console
npm run build-browser
npm run test-browser
```

There's a developer tool ([tools/developer.html](https://github.com/highlightjs/highlight.js/blob/master/tools/developer.html)) for visually testing and debugging language definitions. It requires a browser build to be present. (ie `npm run build-browser` first)

For more details, see [Building and Testing](https://highlightjs.readthedocs.io/en/latest/building-testing.html) in our docs.



================================================
FILE: CONTRIBUTORS.md
================================================
# Contributors


### Core Team

- Josh Goebel  (maintainer)
- Vladimir Jimenez 

### Former Maintainers

- Ivan Sagalaev  (original author)
- Jeremy Hull 
- Oleg Efimov 

### Former Core Team

- Egor Rogov 
- Gidi Meir Morris 
- Jan T. Sott 
- Li Xuanji 
- Marcos Cáceres 
- Sang Dang 


### Individual Contributors

Highlight.js has also been greatly improved over the years thanks to the help of [many other contributors](https://github.com/highlightjs/highlight.js/graphs/contributors).  A big thank you to everyone who has helped make this project what it is today!


================================================
FILE: Dockerfile
================================================
# Dockerfile for highlight.js
#
# Build image:
#   docker build -t highlight-js .
#
# Run container:
#   docker run --rm -it --publish 8080:80 highlight-js
#
#   And open a browser to http://localhost:8080

FROM node:12-slim
RUN apt-get update -qq \
    && apt-get install --yes --no-install-recommends \
        nginx git \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html
COPY package*.json /var/www/html/
RUN npm install
COPY . .
RUN node tools/build.js :common
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]


================================================
FILE: LICENSE
================================================
BSD 3-Clause License

Copyright (c) 2006, Ivan Sagalaev.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


================================================
FILE: MAINTAINERS_GUIDE.md
================================================
Maintainer's Guide
==================


Commit Policy
-------------

* Pull requests from outside contributors require a review from a maintainer.

* Maintainers should avoid working on a main branch directly and create branches for everything. A code review from another maintainer is recommended but not required, use your best judgment.



Release process
---------------

Releases (minor) typically happen on a 6-week schedule.

For major/minor releases you'll be releasing from `main`  For patch releases you'll be releasing from a stable branch, such as `11-stable`.  This allows ongoing development of new features to continue in isolation (in main) without those changes leaking into patch releases (which should focus only on fixing breaking changes).

The goal being that minor version series always get more stable over time and that patch releases do not add features.

* For patch releases: First switch to the associated stable branch (i.e., `11-stable`)

* Update `CHANGES.md` with everything interesting since the last update.

* Update version numbers using the three-part x.y.z notation everywhere:

  * The header in `CHANGES.md` (this is where the site looks for the latest version number)
  * `version` attribute in `package.json`
  * `version` attribute in `package-lock.json` (run `npm install`)
  * `release` variable in `docs/conf.py`
  * All mentions of version number in the `README.md`
  * Update `SECURITY.md` version table

* Commit the version changes and tag the commit with the version number (`10.4.0`, no "v" prefix or anything like that)

* For major/minor releases: Create (or push push) the `[major]-stable` branch such as `11-stable`

IE, the `11-stable` branch should always point to the latest stable release in the 11 series.

* Push the commit the tag (`git push && git push 10.4.0`)


Pushing the tag triggers the update process which can be monitored at http://highlightjs.org/api/release/

When something didn't work *and* it's fixable in code (version numbers mismatch, last minute patches, etc), simply make another release incrementing the third (revision) part of the version number.


================================================
FILE: README.CDN.md
================================================
# Highlight.js CDN Assets

[![install size](https://packagephobia.now.sh/badge?p=highlight.js)](https://packagephobia.now.sh/result?p=highlight.js)

**This package contains only the CDN build assets of highlight.js.**

This may be what you want if you'd like to install the pre-built distributable highlight.js client-side assets via NPM. If you're wanting to use highlight.js mainly on the server-side you likely want the [highlight.js][1] package instead.

To access these files via CDN:
https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@latest/build/ **If you just want a single .js file with the common languages built-in: ** --- ## Highlight.js Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any markup, doesn’t depend on any framework, and has automatic language detection. If you'd like to read the full README:
## License Highlight.js is released under the BSD License. See [LICENSE][7] file for details. ## Links The official site for the library is at . The Github project may be found at: Further in-depth documentation for the API and other topics is at . A list of the Core Team and contributors can be found in the [CONTRIBUTORS.md][8] file. [1]: https://www.npmjs.com/package/highlight.js [7]: https://github.com/highlightjs/highlight.js/blob/main/LICENSE [8]: https://github.com/highlightjs/highlight.js/blob/main/CONTRIBUTORS.md ================================================ FILE: README.md ================================================ # Highlight.js [![latest version](https://badgen.net/npm/v/highlight.js?label=latest)](https://www.npmjs.com/package/highlight.js) [![license](https://badgen.net/github/license/highlightjs/highlight.js?color=cyan)](https://github.com/highlightjs/highlight.js/blob/main/LICENSE) [![install size](https://badgen.net/packagephobia/install/highlight.js?label=npm+install)](https://packagephobia.now.sh/result?p=highlight.js) ![minified](https://img.shields.io/github/size/highlightjs/cdn-release/build/highlight.min.js?label=minified) [![NPM downloads weekly](https://badgen.net/npm/dw/highlight.js?label=npm+downloads&color=purple)](https://www.npmjs.com/package/highlight.js) [![jsDelivr CDN downloads](https://badgen.net/jsdelivr/hits/gh/highlightjs/cdn-release?label=jsDelivr+CDN&color=purple)](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release) [![ci status](https://badgen.net/github/checks/highlightjs/highlight.js/main?label=build)](https://github.com/highlightjs/highlight.js/actions/workflows/tests.js.yml) [![CodeQL](https://github.com/highlightjs/highlight.js/workflows/CodeQL/badge.svg)](https://github.com/highlightjs/highlight.js/actions/workflows/github-code-scanning/codeql) [![vulnerabilities](https://badgen.net/snyk/highlightjs/highlight.js)](https://snyk.io/test/github/highlightjs/highlight.js?targetFile=package.json) [![discord](https://badgen.net/badge/icon/discord?icon=discord&label&color=pink)](https://discord.gg/M24EbU7ja9) [![open issues](https://badgen.net/github/open-issues/highlightjs/highlight.js?label=issues)](https://github.com/highlightjs/highlight.js/issues) [![help welcome issues](https://badgen.net/github/label-issues/highlightjs/highlight.js/help%20welcome/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+welcome%22) [![good first issue](https://badgen.net/github/label-issues/highlightjs/highlight.js/good%20first%20issue/open)](https://github.com/highlightjs/highlight.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It can work with pretty much any markup, doesn’t depend on any other frameworks, and has automatic language detection. **Contents** - [Basic Usage](#basic-usage) - [In the Browser](#in-the-browser) - [Plaintext Code Blocks](#plaintext-code-blocks) - [Ignoring a Code Block](#ignoring-a-code-block) - [Node.js on the Server](#nodejs-on-the-server) - [Supported Languages](#supported-languages) - [Custom Usage](#custom-usage) - [Using custom HTML](#using-custom-html) - [Using with Vue.js](#using-with-vuejs) - [Using Web Workers](#using-web-workers) - [Importing the Library](#importing-the-library) - [Node.js CommonJS Modules / `require`](#nodejs-commonjs-modules--require) - [Node.js ES6 Modules / `import`](#nodejs-es6-modules--import) - [Browser ES6 Modules](#browser-es6-modules) - [Getting the Library](#getting-the-library) - [Fetch via CDN](#fetch-via-cdn) - [cdnjs (link)](#cdnjs-link) - [jsdelivr (link)](#jsdelivr-link) - [unpkg (link)](#unpkg-link) - [Download prebuilt CDN assets](#download-prebuilt-cdn-assets) - [Download from our website](#download-from-our-website) - [Install via NPM package](#install-via-npm-package) - [Build from Source](#build-from-source) - [Requirements](#requirements) - [License](#license) - [Links](#links) --- #### Upgrading to Version 11 As always, major releases do contain breaking changes which may require action from users. Please read [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_11_UPGRADE.md) for a detailed summary of breaking changes and any actions you may need to take. #### Support for older versions Please see [SECURITY.md](https://github.com/highlightjs/highlight.js/blob/main/SECURITY.md) for long-term support information. --- ## Basic Usage ### In the Browser The bare minimum for using highlight.js on a web page is linking to the library along with one of the themes and calling [`highlightAll`][1]: ```html ``` This will find and highlight code inside of `
` tags; it tries
to detect the language automatically. If automatic detection doesn’t
work for you, or you simply prefer to be explicit, you can specify the language manually by using the `class` attribute:


```html
...
``` #### Plaintext Code Blocks To apply the Highlight.js styling to plaintext without actually highlighting it, use the `plaintext` language: ```html
...
``` #### Ignoring a Code Block To skip highlighting of a code block completely, use the `nohighlight` class: ```html
...
``` ### Node.js on the Server The bare minimum to auto-detect the language and highlight some code. ```js // load the library and ALL languages hljs = require('highlight.js'); html = hljs.highlightAuto('

Hello World!

').value ``` To load only a "common" subset of popular languages: ```js hljs = require('highlight.js/lib/common'); ``` To highlight code with a specific language, use `highlight`: ```js html = hljs.highlight('

Hello World!

', {language: 'xml'}).value ``` See [Importing the Library](#importing-the-library) for more examples of `require` vs `import` usage, etc. For more information about the result object returned by `highlight` or `highlightAuto` refer to the [api docs](https://highlightjs.readthedocs.io/en/latest/api.html). ## Supported Languages Highlight.js supports over 180 languages in the core library. There are also 3rd party language definitions available to support even more languages. You can find the full list of supported languages in [SUPPORTED_LANGUAGES.md][9]. ## Custom Usage If you need a bit more control over the initialization of Highlight.js, you can use the [`highlightElement`][3] and [`configure`][4] functions. This allows you to better control *what* to highlight and *when*. For example, here’s the rough equivalent of calling [`highlightAll`][1] but doing the work manually instead: ```js document.addEventListener('DOMContentLoaded', (event) => { document.querySelectorAll('pre code').forEach((el) => { hljs.highlightElement(el); }); }); ``` Please refer to the documentation for [`configure`][4] options. ### Using custom HTML We strongly recommend `
` wrapping for code blocks. It's quite
semantic and "just works" out of the box with zero fiddling. It is possible to
use other HTML elements (or combos), but you may need to pay special attention to
preserving linebreaks.

Let's say your markup for code blocks uses divs:

```html
...
``` To highlight such blocks manually: ```js // first, find all the div.code blocks document.querySelectorAll('div.code').forEach(el => { // then highlight each hljs.highlightElement(el); }); ``` Without using a tag that preserves linebreaks (like `pre`) you'll need some additional CSS to help preserve them. You could also [pre and post-process line breaks with a plug-in][brPlugin], but *we recommend using CSS*. [brPlugin]: https://github.com/highlightjs/highlight.js/issues/2559 To preserve linebreaks inside a `div` using CSS: ```css div.code { white-space: pre; } ``` ### Using with Vue.js See [highlightjs/vue-plugin](https://github.com/highlightjs/vue-plugin) for a simple Vue plugin that works great with Highlight.js. An example of `vue-plugin` in action: ```html
``` ### Using Web Workers You can run highlighting inside a web worker to avoid freezing the browser window while dealing with very big chunks of code. In your main script: ```js addEventListener('load', () => { const code = document.querySelector('#code'); const worker = new Worker('worker.js'); worker.onmessage = (event) => { code.innerHTML = event.data; } worker.postMessage(code.textContent); }); ``` In worker.js: ```js onmessage = (event) => { importScripts('/highlight.min.js'); const result = self.hljs.highlightAuto(event.data); postMessage(result.value); }; ``` ## Importing the Library First, you'll likely be installing the library via `npm` or `yarn` -- see [Getting the Library](#getting-the-library). ### Node.js CommonJS Modules / `require` Requiring the top-level library will load all languages: ```js // require the highlight.js library, including all languages const hljs = require('./highlight.js'); const highlightedCode = hljs.highlightAuto('Hello World!').value ``` For a smaller footprint, load our common subset of languages (the same set used for our default web build). ```js const hljs = require('highlight.js/lib/common'); ``` For the smallest footprint, load only the languages you need: ```js const hljs = require('highlight.js/lib/core'); hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml')); const highlightedCode = hljs.highlight('Hello World!', {language: 'xml'}).value ``` ### Node.js ES6 Modules / `import` The default import will register all languages: ```js import hljs from 'highlight.js'; ``` It is more efficient to import only the library and register the languages you need: ```js import hljs from 'highlight.js/lib/core'; import javascript from 'highlight.js/lib/languages/javascript'; hljs.registerLanguage('javascript', javascript); ``` If your build tool processes CSS imports, you can also import the theme directly as a module: ```js import hljs from 'highlight.js'; import 'highlight.js/styles/github.css'; ``` ### Browser ES6 Modules *Note: For now you'll want to install `@highlightjs/cdn-assets` package instead of `highlight.js`. See [Download prebuilt CDN assets](#download-prebuilt-cdn-assets)* To import the library and register only those languages that you need: ```js import hljs from './assets/js/@highlightjs/cdn-assets/es/core.js'; import javascript from './assets/js/@highlightjs/cdn-assets/es/languages/javascript.min.js'; hljs.registerLanguage('javascript', javascript); ``` To import the library and register all languages: ```js import hljs from './assets/js/@highlightjs/cdn-assets/es/highlight.js'; ``` *Note: The path to these files will vary depending on where you have installed/copied them within your project or site. The above path is only an example.* You can also use [`importmap`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap) to import in similar way as Node: ```html ``` Use the above code in your HTML. After that, your JavaScript can import using the named key from your `importmap`, for example `@highlightjs` in this case: ```js import hljs from '@highlightjs/core.js'; import javascript from '@highlightjs/languages/javascript.min.js'; hljs.registerLanguage('javascript', javascript); ``` *Note: You can also import directly from fully static URLs, such as our very own pre-built ES6 Module CDN resources. See [Fetch via CDN](#fetch-via-cdn) for specific examples.* ## Getting the Library You can get highlight.js as a hosted, or custom-build, browser script or as a server module. Right out of the box the browser script supports both AMD and CommonJS, so if you wish you can use RequireJS or Browserify without having to build from source. The server module also works perfectly fine with Browserify, but there is the option to use a build specific to browsers rather than something meant for a server. **Do not link to GitHub directly.** The library is not supposed to work straight from the source, it requires building. If none of the pre-packaged options work for you refer to the [building documentation][6]. **On Almond.** You need to use the optimizer to give the module a name. For example: ```bash r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js ``` ### Fetch via CDN A prebuilt version of Highlight.js bundled with many common languages is hosted by several popular CDNs. When using Highlight.js via CDN you can use Subresource Integrity for additional security. For details see [DIGESTS.md](https://github.com/highlightjs/cdn-release/blob/main/DIGESTS.md). #### cdnjs ([link](https://cdnjs.com/libraries/highlight.js)) ##### Common JS ```html ``` ##### ES6 Modules ````html ```` #### jsdelivr ([link](https://www.jsdelivr.com/package/gh/highlightjs/cdn-release)) ##### Common JS ```html ``` ##### ES6 Modules ```html ``` #### unpkg ([link](https://unpkg.com/browse/@highlightjs/cdn-assets/)) ##### Common JS ```html ``` ##### ES6 Modules ```html ``` **Note:** *The CDN-hosted `highlight.min.js` package doesn't bundle every language.* It would be very large. You can find our list of "common" languages that we bundle by default on our [download page][5]. ### Download prebuilt CDN assets You can also download and self-host the same assets we serve up via our own CDNs. We publish those builds to the [cdn-release](https://github.com/highlightjs/cdn-release) GitHub repository. You can easily pull individual files off the CDN endpoints with `curl`, etc; if say you only needed `highlight.min.js` and a single CSS file. There is also an npm package [@highlightjs/cdn-assets](https://www.npmjs.com/package/@highlightjs/cdn-assets) if pulling the assets in via `npm` or `yarn` would be easier for your build process. ### Download from our website The [download page][5] can quickly generate a custom single-file minified bundle including only the languages you desire. **Note:** [Building from source](#build-from-source) can produce slightly smaller builds than the website download. ### Install via NPM package Our NPM package including all supported languages can be installed with NPM or Yarn: ```bash npm install highlight.js # or yarn add highlight.js ``` There is also another npm package [@highlightjs/cdn-assets](https://www.npmjs.com/package/@highlightjs/cdn-assets) that contains prebuilt CDN assets including [ES6 Modules that can be imported in browser](#browser-es6-modules): ```bash npm install @highlightjs/cdn-assets # or yarn add @highlightjs/cdn-assets ``` Alternatively, you can build the NPM package from source. ### Build from Source The [current source code][10] is always available on GitHub. ```bash node tools/build.js -t node node tools/build.js -t browser :common node tools/build.js -t cdn :common ``` See our [building documentation][6] for more information. ## Requirements Highlight.js works on all modern browsers and currently supported Node.js versions. You'll need the following software to contribute to the core library: - Node.js >= 12.x - npm >= 6.x ## License Highlight.js is released under the BSD License. See our [LICENSE][7] file for details. ## Links The official website for the library is . Further in-depth documentation for the API and other topics is at . A list of the Core Team and contributors can be found in the [CONTRIBUTORS.md][8] file. [1]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightall [2]: http://highlightjs.readthedocs.io/en/latest/css-classes-reference.html [3]: http://highlightjs.readthedocs.io/en/latest/api.html#highlightelement [4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure [5]: https://highlightjs.org/download/ [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html [7]: https://github.com/highlightjs/highlight.js/blob/main/LICENSE [8]: https://github.com/highlightjs/highlight.js/blob/main/CONTRIBUTORS.md [9]: https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md [10]: https://github.com/highlightjs/ ================================================ FILE: SECURITY.md ================================================ # Security Policy Due to both time and resource constrains the Highlight.js core team fully supports only the current major/minor release of the library. Prior major releases may be supported for a short time after new major releases are issued. Problems with minor releases are often resolved by upgrading to the most recent minor release. ### Release Status | Version | Support | Status | | :-----: | :-: | :------ | | 11.x | :white_check_mark: | The 11.x series recieves regular updates, new features & security fixes. | | 10.7.x | :x: | No longer supported.
See [VERSION_11_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/master/VERSION_11_UPGRADE.md).| | <= 10.4.0 | :x: | Known vulnerabities. | | <= 9.18.5 | :x: | Known vulnerabities. [EOL](https://github.com/highlightjs/highlight.js/issues/2877) | | 7.x, 8.x | :x: | Obsolete. Known vulnerabities. | ### Reporting a Vulnerability Many vulnerabilities can simply be reported (and tracked) via our [GitHub issues](https://github.com/highlightjs/highlight.js/issues). If you feel your issue is more sensitive than that you can always reach us via email: [security@highlightjs.org](mailto:security@highlightjs.org) ================================================ FILE: SUPPORTED_LANGUAGES.md ================================================ # Supported Languages The table below shows the full list of languages (and corresponding classes/aliases) supported by Highlight.js. Languages that list a **Package** below are 3rd party languages and are not bundled with the core library. You can find their repositories by following the links. **Note:** The languages available will depend on how you've built or are included the library in your app. For example our default minified web build includes only ~40 popular languages. See [Getting the Library][1] and [Importing the Library][2] in the README for examples of how to load additional/specific languages. | Language | Aliases | Package | | :-----------------------| :--------------------- | :------ | | 1C | 1c | | | 4D | 4d |[highlightjs-4d](https://github.com/highlightjs/highlightjs-4d) | | ABAP | sap-abap, abap |[highlight-sap-abap](https://github.com/highlightjs/highlightjs-sap-abap) | | Abc Notation | abc |[highlightjs-abc](https://github.com/nocpiun/highlightjs-abc)| | ABNF | abnf | | | Access logs | accesslog | | | ActionScript | actionscript, as | | | Ada | ada | | | Aiken | aiken, ak | [highlightjs-aiken](https://github.com/yHSJ/highlightjs-aiken) | | Alan | ln | [highlightjs-alan](https://github.com/alantech/highlightjs-alan) | | Alan IF | alan, i | [highlightjs-alan](https://github.com/highlightjs/highlightjs-alan) | | AngelScript | angelscript, asc | | | Apache | apache, apacheconf | | | Apex | apex | [highlightjs-apex](https://github.com/highlightjs/highlightjs-apex/) | | AppleScript | applescript, osascript | | | Arcade | arcade | | | Arduino (C++ w/Arduino libs) | arduino, ino | | | ARM assembler | armasm, arm | | | AsciiDoc | asciidoc, adoc | | | AspectJ | aspectj | | | AutoHotkey | autohotkey | | | AutoIt | autoit | | | AVR assembler | avrasm | | | Awk | awk, mawk, nawk, gawk | | | Ballerina | ballerina, bal | [highlightjs-ballerina](https://github.com/highlightjs/highlightjs-ballerina) | | Bash | bash, sh, zsh | | | BASIC | basic | | | BBCode | bbcode | [highlightjs-bbcode](https://github.com/RedGuy12/highlightjs-bbcode) | | Bicep | bicep | [highlightjs-bicep](https://github.com/Azure/bicep/blob/main/docs/highlighting.md#highlightjs) | | Blade (Laravel) | blade | [highlightjs-blade](https://github.com/miken32/highlightjs-blade) | | BNF | bnf | | | BQN | bqn | [highlightjs-bqn](https://github.com/razetime/highlightjs-bqn) | | Brainfuck | brainfuck, bf | | | C | c, h | | | C# | csharp, cs | | | C++ | cpp, hpp, cc, hh, c++, h++, cxx, hxx | | | C/AL | cal | | | C3 | c3 | [highlightjs-c3](https://github.com/highlightjs/highlightjs-c3) | | Cache Object Script | cos, cls | | | Candid | candid, did | [highlightjs-motoko](https://github.com/rvanasa/highlightjs-motoko) | | Cap’n Proto | capnproto, capnp | | | Chaos | chaos, kaos | [highlightjs-chaos](https://github.com/chaos-lang/highlightjs-chaos) | | Chapel | chapel, chpl | [highlightjs-chapel](https://github.com/chapel-lang/highlightjs-chapel) | | Cisco CLI | cisco | [highlightjs-cisco-cli](https://github.com/BMatheas/highlightjs-cisco-cli) | | Clojure | clojure, clj | | | CMake | cmake, cmake.in | | | COBOL | cobol, standard-cobol | [highlightjs-cobol](https://github.com/otterkit/highlightjs-cobol) | | CODEOWNERS | codeowners | [highlightjs-codeowners](https://github.com/highlightjs/highlightjs-codeowners) | | CoffeeScript | coffeescript, coffee, cson, iced | | | Coq | coq | | | CpcdosC+ | cpc | [highlightjs-cpcdos](https://github.com/SPinti-Software/highlightjs-cpcdos) | | Crmsh | crmsh, crm, pcmk | | | Crystal | crystal, cr | | | CSP | csp | | | CSS | css | | | cURL | curl | [highlightjs-curl](https://github.com/highlightjs/highlightjs-curl) | | Cypher (Neo4j) | cypher | [highlightjs-cypher](https://github.com/highlightjs/highlightjs-cypher) | | D | d | | | Dafny | dafny | [highlightjs-dafny](https://github.com/ConsenSys/highlightjs-dafny)| | Dart | dart | | | Delphi | dpr, dfm, pas, pascal | | | Diff | diff, patch | | | Django | django, jinja | | | DNS Zone file | dns, zone, bind | | | Dockerfile | dockerfile, docker | | | DOS | dos, bat, cmd | | | dsconfig | dsconfig | | | DTS (Device Tree) | dts | | | Dust | dust, dst | | | Dylan | dylan | [highlightjs-dylan](https://github.com/highlightjs/highlightjs-dylan) | | EBNF | ebnf | | | Elixir | elixir | | | Elm | elm | | | Erlang | erlang, erl | | | Excel | excel, xls, xlsx | | | Extempore | extempore, xtlang, xtm | [highlightjs-xtlang](https://github.com/highlightjs/highlightjs-xtlang) | | F# | fsharp, fs, fsx, fsi, fsscript | | | 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 | | | GDScript | godot, gdscript | [highlightjs-gdscript](https://github.com/highlightjs/highlightjs-gdscript) | | Gherkin | gherkin | | | Gleam | gleam | [gleam-highlight.js](https://github.com/gleam-lang/gleam-highlight.js) | | Glimmer and EmberJS | hbs, glimmer, html.hbs, html.handlebars, htmlbars | [highlightjs-glimmer](https://github.com/NullVoxPopuli/highlightjs-glimmer) | | GN for Ninja | gn, gni | [highlightjs-GN](https://github.com/highlightjs/highlightjs-GN) | | Go | go, golang | | | Golo | golo, gololang | | | Gradle | gradle | | | Grammatical Framework | gf | [highlightjs-gf](https://github.com/johnjcamilleri/highlightjs-gf) | | GraphQL | graphql, gql | | | Groovy | groovy | | | GSQL | gsql | [highlightjs-gsql](https://github.com/DanBarkus/highlightjs-gsql) | | Haml | haml | | | Handlebars | handlebars, hbs, html.hbs, html.handlebars | | | Haskell | haskell, hs | | | Haxe | haxe, hx | | | High-level shader language| hlsl | [highlightjs-hlsl](https://github.com/highlightjs/highlightjs-hlsl) | | HTML, XML | xml, html, xhtml, rss, atom, xjb, xsd, xsl, plist, svg | | | HTTP | http, https | | | Hy | hy, hylang | | | Inform7 | inform7, i7 | | | Ini, TOML | ini, toml | | | Iptables | iptables | [highlightjs-iptables](https://github.com/highlightjs/highlightjs-iptables) | | IRPF90 | irpf90 | | | Java | java, jsp | | | JavaScript | javascript, js, jsx | | | Jolie | jolie, iol, ol | [highlightjs-jolie](https://github.com/xiroV/highlightjs-jolie) | | JSON | json, jsonc, json5 | | | JSONata | jsonata | [highlightjs-jsonata](https://github.com/DevDimov/highlightjs-jsonata) | | Julia | julia, jl | | | Julia REPL | julia-repl | | | Kotlin | kotlin, kt | | | L4 | l4, legal | [highlightjs-l4](https://github.com/legalese/highlightjs-l4) | Lang | | [highlightjs-lang](https://github.com/highlightjs/highlightjs-lang) | Lasso | lasso, ls, lassoscript | | | LaTeX | tex | | | LDIF | ldif | | | Leaf | leaf | | | Lean | lean | [highlightjs-lean](https://github.com/leanprover-community/highlightjs-lean) | | Less | less | | | Liquid | liquid | [highlightjs-liquid](https://github.com/highlightjs/highlightjs-liquid) | | Lisp | lisp | | | LiveCode Server | livecodeserver | | | LiveScript | livescript, ls | | | LookML | lookml | [highlightjs-lookml](https://github.com/spectacles-ci/highlightjs-lookml) | | Lua | lua, pluto | | | Luau | luau | [highlightjs-luau](https://github.com/highlightjs/highlightjs-luau) | | Macaulay2 | macaulay2 | [highlightjs-macaulay2](https://github.com/d-torrance/highlightjs-macaulay2) | | Magik | magik | [highlightjs-magik](https://github.com/sebastiaanspeck/highlightjs-magik) | | Makefile | makefile, mk, mak, make | | | Markdown | markdown, md, mkdown, mkd | | | Mathematica | mathematica, mma, wl | | | Matlab | matlab | | | Maxima | maxima | | | Maya Embedded Language | mel | | | Mercury | mercury | | | MetaPost | metapost | [highlightjs-metapost](https://github.com/chupinmaxime/highlightjs-metapost) | | | Mint | mint | [highlightjs-mint](https://github.com/mint-lang/highlightjs-mint) | | MIPS Assembler | mips, mipsasm | | | mIRC Scripting Language | mirc, mrc | [highlightjs-mirc](https://github.com/highlightjs/highlightjs-mirc) | | Mirth | mirth | [highlightjs-mirth](https://github.com/highlightjs/highlightjs-mirth) | | Mizar | mizar | | | MKB | mkb | [highlightjs-mkb](https://github.com/Dereavy/highlightjs-mkb) | | MLIR | mlir | [highlightjs-mlir](https://github.com/highlightjs/highlightjs-mlir) | | Mojolicious | mojolicious | | | Monkey | monkey | | | Moonscript | moonscript, moon | | | Motoko | motoko, mo | [highlightjs-motoko](https://github.com/rvanasa/highlightjs-motoko) | | N1QL | n1ql | | | Never | never | [highlightjs-never](https://github.com/never-lang/highlightjs-never) | | Nginx | nginx, nginxconf | | | Nim | nim, nimrod | | | Nix | nix | | | NSIS | nsis | | | Oak | oak | [highlightjs-oak](https://github.com/timlabs/highlightjs-oak) | | Object Constraint Language | ocl | [highlightjs-ocl](https://github.com/nhomble/highlightjs-ocl) | | Objective C | objectivec, mm, objc, obj-c, obj-c++, objective-c++ | | | OCaml | ocaml, ml | | | Odin | odin | [highlightjs-odinlang](https://github.com/marianpekar/highlightjs-odinlang) | | OpenGL Shading Language | glsl | | | OpenSCAD | openscad, scad | | | Oracle Rules Language | ruleslanguage | | | Oxygene | oxygene | | | Papyrus | papyrus, psc |[highlightjs-papyrus](https://github.com/Pickysaurus/highlightjs-papyrus) | | Parser3 | parser3 | | | Perl | perl, pl, pm | | | PF | pf, pf.conf | | | Phix | phix | [highlightjs-phix](https://github.com/highlightjs/highlightjs-phix) | | PHP | php | | | Pine Script | pine, pinescript | [highlightjs-pine](https://github.com/jeyllani/highlightjs-pine) | | Plaintext | plaintext, txt, text | | | Pony | pony | | | PostgreSQL & PL/pgSQL | pgsql, postgres, postgresql | | | PowerOn | poweron, po | [highlightjs-poweron](https://github.com/libum-llc/highlightjs-poweron) | | PowerShell | powershell, ps, ps1 | | | Prisma | prisma | [highlightjs-prisma](https://github.com/witch-factory/highlightjs-prisma) | | Processing | processing | | | Prolog | prolog | | | Properties | properties | | | Protocol Buffers | proto, protobuf | | | Puppet | puppet, pp | | | Python | python, py, gyp | | | Python profiler results | profile | | | Python REPL | python-repl, pycon | | | Q | k, kdb | | | Q# | qsharp | [highlightjs-qsharp](https://github.com/fedonman/highlightjs-qsharp) | | QML | qml | | | R | r | | | Raku | raku, perl6, p6, pm6, rakumod | [highlightjs-raku](https://github.com/highlightjs/highlightjs-raku) | | RakuDoc | pod6, rakudoc | [highlightjs-raku](https://github.com/highlightjs/highlightjs-raku) | | RakuQuoting | rakuquoting | [highlightjs-raku](https://github.com/highlightjs/highlightjs-raku) | | RakuRegexe | rakuregexe | [highlightjs-raku](https://github.com/highlightjs/highlightjs-raku) | | Razor CSHTML | cshtml, razor, razor-cshtml | [highlightjs-cshtml-razor](https://github.com/highlightjs/highlightjs-cshtml-razor) | | ReasonML | reasonml, re | | | Rebol & Red | redbol, rebol, red, red-system | [highlightjs-redbol](https://github.com/oldes/highlightjs-redbol) | | RenderMan RIB | rib | | | RenderMan RSL | rsl | | | ReScript | rescript, res | [highlightjs-rescript](https://github.com/tsnobip/highlightjs-rescript) | | RISC-V Assembly | riscv, riscvasm | [highlightjs-riscvasm](https://github.com/highlightjs/highlightjs-riscvasm) | | RiScript | risc, riscript | [highlightjs-riscript](https://github.com/highlightjs/highlightjs-riscript) | | Roboconf | graph, instances | | | Robot Framework | robot, rf | [highlightjs-robot](https://github.com/highlightjs/highlightjs-robot) | | 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 | | | Scala | scala | | | Scheme | scheme | | | Scilab | scilab, sci | | | SCSS | scss | | | SFZ | sfz | [highlightjs-sfz](https://github.com/sfz/highlight.js) | | Shape Expressions | shexc | [highlightjs-shexc](https://github.com/highlightjs/highlightjs-shexc) | | Shell | shell, console | | | Smali | smali | | | Smalltalk | smalltalk, st | | | SML | sml, ml | | | Solidity | solidity, sol | [highlightjs-solidity](https://github.com/highlightjs/highlightjs-solidity) | | Splunk SPL | spl | [highlightjs-spl](https://github.com/swsoyee/highlightjs-spl) | | SQL | sql | | | Stan | stan, stanfuncs | | | Stata | stata | | | STEP Part 21 | p21, step, stp | | | Structured Text | iecst, scl, stl, structured-text | [highlightjs-structured-text](https://github.com/highlightjs/highlightjs-structured-text) | | Stylus | stylus, styl | | | SubUnit | subunit | | | Supercollider | supercollider, sc | [highlightjs-supercollider](https://github.com/highlightjs/highlightjs-supercollider) | | Svelte | svelte | [highlight.svelte](https://github.com/moonlitgrace/highlight.svelte) | | Swift | swift | | | Tcl | tcl, tk | | | Terraform (HCL) | terraform, tf, hcl | [highlightjs-terraform](https://github.com/highlightjs/highlightjs-terraform) | | Test Anything Protocol | tap | | | Thrift | thrift | | | Toit | toit | [toit-highlight](https://github.com/snxx-lppxx/toit-highlight) | | TP | tp | | | Transact-SQL | tsql | [highlightjs-tsql](https://github.com/highlightjs/highlightjs-tsql) | | TTCN-3 | ttcn, ttcnpp, ttcn3 | [highlightjs-ttcn3](https://gitea.osmocom.org/ttcn3/highlightjs-ttcn3) | | Twig | twig, craftcms | | | TypeScript | typescript, ts, tsx, mts, cts | | | Unicorn Rails log | unicorn-rails-log | [highlightjs-unicorn-rails-log](https://github.com/sweetppro/highlightjs-unicorn-rails-log) | | Unison | unison, u | [highlightjs-unison](https://github.com/highlightjs/highlightjs-unison) | | Vala | vala | | | VB.Net | vbnet, vb | | | VBA | vba | [highlightjs-vba](https://github.com/dullin/highlightjs-vba) | | VBScript | vbscript, vbs | | | Verilog | verilog, v | | | VHDL | vhdl | | | Vim Script | vim | | | VoltScript | voltscript, vss, lotusscript, lss | [highlightjs-voltscript](https://github.com/HCL-TECH-SOFTWARE/highlightjs-voltscript) | | WGSL | wgsl | [highlightjs-wgsl](https://github.com/highlightjs/highlightjs-wgsl) | | X# | xsharp, xs, prg | [highlightjs-xsharp](https://github.com/InfomindsAg/highlightjs-xsharp) | | X++ | axapta, x++ | | | x86 Assembly | x86asm | | | x86 Assembly (AT&T) | x86asmatt | [highlightjs-x86asmatt](https://github.com/gondow/highlightjs-x86asmatt) | | XL | xl, tao | | | XQuery | xquery, xpath, xq, xqm | | | YAML | yml, yaml | | | ZenScript | zenscript, zs |[highlightjs-zenscript](https://github.com/highlightjs/highlightjs-zenscript) | | Zephir | zephir, zep | | | Zig | zig |[highlightjs-zig](https://github.com/fwx5618177/highlightjs-zig) | ## Alias Overlap If you are using either of these languages at the same time please be sure to use the full name and not the alias to avoid any ambiguity. | Language | Overlap | | :-----------------------| :--------------------- | | Lasso | ls | | LiveScript | ls | | OCaml | ml | | SML | ml | [1]: https://github.com/highlightjs/highlight.js#getting-the-library [2]: https://github.com/highlightjs/highlight.js#importing-the-library ================================================ FILE: VERSION_10_BREAKING_CHANGES.md ================================================ ## Version 10 Breaking Changes Incompatibilities: - chore(parser): compressed version 9.x language definitions no longer supported (rebuild them minified) [Josh Goebel][] - `nohightlight` and `no-highlight` are the only "ignore me" css classes now (`plain` and `text` no longer count) (to get the old behavior you can customize `noHighlightRe`) - a grammar with a top-level `self` reference will now always throw an error (previously in safe mode this would be silently ignored) - PHP templates are now detected as `php-template`, not `xml` Renamed Language Files: - chore(parser): `htmlbars.js` now depends on `handlebars.js` [Josh Goebel][] - chore(parser): rename `nimrod.js` to `nim.js` [Josh Goebel][] - chore(parser): rename `cs.js` to `csharp.js` [Josh Goebel][] - chore(parser): rename `tex.js` to `latex.js` [Josh Goebel][] - chore(parser): effectively rename `cpp.js` to `c-like.js` [Josh Goebel][] - chore(parser): create new `c.js` (C), depends on `c-like` now [Josh Goebel][] - chore(parser): create new `cpp.js` (C), depends on `c-like` now [Josh Goebel][] - This will allow us to clean up C/C++ in the future without another breaking change by getting this require change out of the way early. (https://github.com/highlightjs/highlight.js/issues/2146) Legacy Browser Issues: - **We're now using ES2015 features in the codebase. Internet Explorer 11 is no longer supported.** - In general legacy browsers are no longer supported. - chore(parser): remove `load` listener in favor of only the newer `DOMContentLoaded` [Josh Goebel][] Removed styles: - chore(styles): darkula.css (use darcula.css instead) [Josh Goebel][] [Josh Goebel]: https://github.com/joshgoebel --- Also see: https://github.com/highlightjs/highlight.js/issues/2273 ================================================ FILE: VERSION_10_UPGRADE.md ================================================ # Upgrading to Version 10.0 Welcome to version 10.0. This a major release and therefore will contain breaking changes. ## Breaking Changes Our normal minor releases try to never break anything, holding all breaking changes for major releases. We tried to squeeze in as many as we could this time so that after 10.0 ships we'll be back to quiet sailing for a while before we need to push version 11. That said, we're very conservative about what we consider a breaking change. *IE, if there it could possibly break things for anyone, it's typically a breaking change.* The fact is a vast majority of users should upgrade and probably not notice any changes at all. See [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_BREAKING_CHANGES.md) for a comprehensive list of breaking changes, but here is a summary... if you use: ### Core highlight.js lib on the client (with no extra CDN languages) Just keep doing that. - If you're using `darkula.css`, you'll need to change that to `darcula.css` - The minified distributable has changed from `.pack.js` to `.min.js`, update your name when you update your URL. - If your users have very old browsers, they may no longer be supported (no more IE11, etc.). (We're using ES2015 code now.) - `nohighlight` or `no-highlight` are the only two CSS classes that will SKIP highlighting completely. `*text*` and `*plain*` no longer will do this. ### Core highlight.js lib on the client (plus additional CDN languages) Quite a few grammars have been renamed. Ex: `nimrod.js` is now `nim.js`. - Check the renamed grammars to see if you might need to update your links. - Be aware that you can't use version 9 CDN JS files anymore, they aren't compatible. - Plus read the above list of items. ### highlight.js on the server (via NPM) and only use the public API If you're just pulling in the FULL library (`require('./highlight.js')`) just keep doing that. You might not need to change anything. - If you're manually loading a smaller set of languages and using `registerLanguage` make sure you check out all the renamed grammars and dependency changes. - Read the client-side lists above also. ### highlight.js on the server (via NPM) with a custom integration Read the complete breaking changes list carefully. - Read the client-side lists above also. ### highlight.js lib on the client, with source directly from our GitHub repo That will no longer work. The source needs to be built to work properly and cannot be used "raw" unless you've also setup your own build pipeline (rollup, etc.). Fetch a static build from the CDN, the [cdn-release repo](https://github.com/highlightjs/cdn-release) or use the new [`highlightjs-dist`]() NPM package. ### highlight.js source code directly from our GitHub repo with a custom integration All bets are off, since we only try to guarantee stability of our NPM and CDN builds and the public API. Read all the breaking changes and perhaps skim the commit history. - We're using ES6 modules now. - We're using an entirely new build system. - The source will likely become more and more modular during the 10.0 timeline. ## Enjoy and good luck. As always if you have any questions or issues, jump on the [Github Issues](https://github.com/highlightjs/highlight.js/issues). ================================================ FILE: VERSION_11_UPGRADE.md ================================================ # Upgrading to Highlight.js v11.0 - [Overview of Breaking Changes](#overview-of-breaking-changes) - [Built-in set of "Common" Languages](#built-in-set-of-common-languages) - [Language Files](#language-files) - [Language Aliases](#language-aliases) - [Styles and CSS](#styles-and-css) - [Grammar Scopes](#grammar-scopes) - [Behavioral changes](#behavioral-changes) - [API changes](#api-changes) - [Changes to Result Data](#changes-to-result-data) - [Feature Removal](#feature-removal) - [Small Things](#small-things) - [Upgrading from Version 9.x](#upgrading-from-version-9x) ## Overview of Breaking Changes Welcome to version 11.0. This a major release and therefore contains breaking changes. Below is a complete list of those such changes. ### Built-in set of "Common" Languages The default `highlight.min.js` build **removes** a few less popular grammars: - apache - http - nginx - properties - coffeescript If you need any of these, you can always create a custom build. Ref: https://github.com/highlightjs/highlight.js/issues/2848 ### Language Files This would matter if you are requiring any of these files directly (via Node.js or CDN). - `htmlbars` has been removed. Use `handlebars` instead. - `c-like` has been removed. Use `c`, `cpp`, or `arduino`. - `sql_more` has been removed. Use `sql` instead or a more specific 3rd party grammar. ### Language Aliases This would matter if you are using these aliases. - `php3`,`php4`,`php5`, `php6`, `php7`, and `php8` have been removed. Use `php` instead. - `zsh` has been removed. Use `sh` or `bash` instead. - `freepascal`, `lazarus`, `lpr`, and `lpm` removed. Use `delphi` instead. You can of course re-register any of these aliases easily if necessary. For example to restore the PHP aliases: ```js hljs.registerAliases(["php3","php4","php5","php6","php7","php8"],{ languageName: "php" }) ``` ### Styles and CSS - The default padding on `.hljs` element has been increased and is now `1em` (it was `0.5em` previously). If your design depends on the smaller spacing you may need to update your CSS to override. - `schoolbook` no longer has a custom lined background, it is solid color now. The old image and CSS can be found in the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles) if you wish to manually copy it into your project. - `github` includes significant changes to more properly match modern GitHub syntax highlighting. If you desire the old theme you can manually copy it into your project from the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles). - `github-gist` has been removed in favor of `github` as GitHub and GitHub Gist have converged. If you desire the theme you can manually copy it into your project from the [10-stable branch](https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles). - The `.hljs` CSS selector is now further scoped. It now targets `code.hljs` (inline code) and `pre code.hljs` (code blocks). If you are using a different element you may need to update your CSS to reapply some styling. - All [Base16 themes](https://github.com/highlightjs/base16-highlightjs) now live in the `styles/base16` directory - this means some CSS files have moved. Please confirm themes you use reference the new locations. #### Grammar Scopes - `.meta-string` removed/deprecated. Use `.meta .string` (a nested scope) instead. See [meta-keyword][]. - `.meta-keyword` removed/deprecated. Use `.meta .keyword` (a nested scope) instead. See [meta-keyword][]. ### Behavioral changes - `after:highlightElement` plugin callback is now fired *after* the DOM has been updated, not before. #### API changes - The option `ignoreIllegals` is now `true` by default (for `highlight()`). Previously it was `false`. - The `highlight(language,code, ...args)` API no longer accepts `continuation` as a 4th argument. - The `highlight(language,code, ...args)` API is deprecated (to be removed in 12.0). The new call signature is `highlight(code, {options})`. ([see docs](https://highlightjs.readthedocs.io/en/latest/api.html#highlight)) Code using the old API: ```js // highlight(language, code, ignoreIllegals, continuation) highlight("javascript", "var a = 5;", true) ``` ...would be upgraded to the newer API as follows: ```js // highlight(code, {language, ignoreIllegals}) highlight("var a = 5;", {language: "javascript", ignoreIllegals: true}) ``` The new API purposely does not support `continuation` as this is only intended for internal library usage. - `initHighlighting()` is deprecated (to be removed in 12.0). - `initHighlightingOnLoad()` is deprecated (to be removed in 12.0). **Use `highlightAll()` instead.** ([see docs](https://highlightjs.readthedocs.io/en/latest/api.html#highlight-all)) The old functions are now simply aliases of `highlightAll()`. The new function may be called before or after the DOM is loaded and should do the correct thing in all cases, replacing the need for the previous individual functions. Note: `highlightAll()` does not guard against calling itself repeatedly as the previous functions did. Your code should be careful to avoid doing this. - `highlightBlock()` is deprecated (to be removed in 12.0). **Use `highlightElement()` instead.** ([see docs](https://highlightjs.readthedocs.io/en/latest/api.html#highlight-element)) This is merely a naming change. Note: The object literal passed to the `before:highlightElement` callback now passes the element in the `el` key vs the `block` key. ##### Changes to Result Data - `highlightAuto()`'s `second_best` key has been renamed to `secondBest` - `highlightElement()`'s result now no longer includes a `re` key. Use the `relevance` key now. - `highlight()` renames some result keys to more clearly mark them as private: `_top`, `_emitter`, and `_illegalBy`. You should not depend on these keys as they are subject to change at any time. - The `relevance` key returned by `highlight()` is no longer guaranteed to be an even integer. - `highlightElement` now always tags blocks with a consistent `language-[name]` class This behavior was inconsistent before. Sometimes `[name]` class would be added, sometimes the alias name would be added, something no class would be added. now `language-[name]` is always added. This also affects sublanguage `span` tags which now also include the `language-` prefix. #### Feature Removal - HTML auto-passthru is now no longer included in core. Use a plugin instead. For a possible plugin please see [#2889](https://github.com/highlightjs/highlight.js/issues/2889). An example: ```html

var a = 4;
var a = 4;
``` Unescaped HTML like this will now be ignored (stripped before highlighting) and a warning will be logged to the console. All HTML to be highlighted should be properly escaped to avoid potential HTML/JS injection attacks. - `fixMarkup` has been removed. This function was deprecated in v10.2. It is not our goal to provide random string utilities. You may need to provide your own replacement [Ref: #2534](https://github.com/highlightjs/highlight.js/issues/2634) - `CSS_NUMBER_MODE` has been removed. This rule was too broad for bring inclusion in core and has been removed. - `lexemes` mode attribute has been removed. Use the new `keywords.$pattern` instead. Before: ```js { keywords: "do.it start.now begin.later end.immediately" lexemes: /[a-z.]+/ } ``` After: ```js { keywords: { $pattern: /[a-z.]+/ keyword: "do.it start.now begin.later end.immediately", } } ``` This may required converting your `keywords` key into an object if it's not already (as shown above). - `endSameAsBegin` mode attribute has been removed. Use the new `END_SAME_AS_BEGIN` mode rule/function instead. - `useBR` configuration has been removed. This configuration option was deprecated in v10.1. Use a plugin or preferably simply CSS `white-space: pre`. [Ref: #2559](https://github.com/highlightjs/highlight.js/issues/2559) - `tabReplace` configuration has been removed. This configuration option was deprecated in v10.5. Use a plugin or pre-render content instead with desired spacing. [Ref: #2874](https://github.com/highlightjs/highlight.js/issues/2874) ### Small Things - The `regex` utility `join` has been renamed to `_eitherRewriteBackreferences` (this has always been intended for internal use only) ### Upgrading from Version 9.x If you're upgrading all the way from version 9 it may still be helpful to review all the breaking changes in version 10 as well: - [VERSION_10_UPGRADE.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_UPGRADE.md) - [VERSION_10_BREAKING_CHANGES.md](https://github.com/highlightjs/highlight.js/blob/main/VERSION_10_BREAKING_CHANGES.md) [meta-keyword]: https://github.com/highlightjs/highlight.js/pull/3167 ================================================ FILE: demo/demo.js ================================================ hljs.debugMode(); hljs.highlightAll(); document.querySelectorAll(".categories li a").forEach((category) => { category.addEventListener("click", (event) => { event.preventDefault(); const current = document.querySelector(".categories .current"); const currentCategory = current.dataset.category; const nextCategory = event.target.dataset.category; if (currentCategory !== nextCategory) { current.classList.remove("current"); event.target.classList.add("current"); document .querySelectorAll(`.${currentCategory}`) .forEach((language) => language.classList.add("hidden")); document .querySelectorAll(`.${nextCategory}`) .forEach((language) => language.classList.remove("hidden")); window.scrollTo(0, 0); } }); }); document.querySelectorAll(".styles li a").forEach((style) => { style.addEventListener("click", (event) => { event.preventDefault(); const current = document.querySelector(".styles .current"); const currentStyle = current.textContent; const nextStyle = event.target.textContent; if (currentStyle !== nextStyle) { document .querySelector(`link[title="${nextStyle}"]`) .removeAttribute("disabled"); document .querySelector(`link[title="${currentStyle}"]`) .setAttribute("disabled", "disabled"); current.classList.remove("current"); event.target.classList.add("current"); } }); }); ================================================ FILE: demo/index.html ================================================ highlight.js demo <% styles.forEach(({ name, path }) => {%> <% }); %>
<% languages.forEach(({categories, name, prettyName, sample}) => { %>

<%= prettyName %>

<%- sample %>
<% }); %>
================================================ FILE: demo/readme.md ================================================ To view this demo in browser, please follow the [build instructions](http://highlightjs.readthedocs.io/en/latest/building-testing.html#building) with browser as the target, and then open the generated build/demo/index.html. ================================================ FILE: demo/style.css ================================================ @import url(https://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic); /* Base styles */ body { color: #f0f0f0; background: #500; font-family: PT Sans, DejaVu Sans, Arial, sans; margin: 0; padding: 0; } a { color: #f0f0f0; } h1 { font-size: 150%; margin: 0; padding: 1em 0 0.5em; } h2 { font-size: 120%; margin: 1.5em 0 0.5em 0; } pre { margin: 0; } code { display: block; font-family: Consolas, Monaco, monospace; font-size: 10pt; overflow-x: auto; padding: 0.5em; scrollbar-width: thin; -moz-tab-size: 4; tab-size: 4; } pre code.hljs { /* compatible with school-book */ padding: 16px 30px 20px; } aside { background: #600; bottom: 0; box-shadow: 0 0 1em #000000; display: flex; flex-direction: column; left: 0; padding: 0 1.5em 1em; position: fixed; top: 0; width: 16em; } .categories { flex: 0 4 25%; } .styles { flex: 1 1 50%; } aside ul, aside li { list-style: none; margin: 0; padding: 0; } aside ul { position: relative; overflow-y: auto; scrollbar-width: thin; } aside ul::-webkit-scrollbar { width: 8px; } aside ul::-webkit-scrollbar-track { background: #4d0607; border-radius: 5px; } aside ul::-webkit-scrollbar-thumb { background: #926868; border-right: 1px solid #4d0607; border-left: 1px solid #4d0607; border-radius: 5px; } aside ul::-webkit-scrollbar-thumb:hover { background: #7f5555; } aside ul::-webkit-scrollbar-thumb:active { background: #5d3333; } aside ul a { display: block; padding: 1px 0.5em 1px 1em; text-decoration: none; } aside ul a:focus, aside ul a:hover { background: #500; outline: none; } aside ul a.current:before { content: "▶"; font-size: smaller; position: absolute; left: 0; } main { margin-left: 18em; min-width: 36em; padding: 1px 4em; } main > div { margin: 2.5em 0 3em; } .hidden { display: none; } ================================================ FILE: docs/Makefile ================================================ # Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/highlightjs.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/highlightjs.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/highlightjs" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/highlightjs" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." ================================================ FILE: docs/_static/.gitkeep ================================================ ================================================ FILE: docs/_templates/.gitkeep ================================================ ================================================ FILE: docs/api.rst ================================================ Core API ======== Highlight.js exports a few functions as methods of the ``hljs`` object. .. _newerapi: highlight --------- :: highlight(code, {language, ignoreIllegals}) 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 that when ``true`` forces highlighting to finish even in case of detecting illegal syntax for the language instead of throwing an exception. Returns an object with the following properties: * ``language``: language name, same as the name passed in ``languageName``, returned for consistency with ``highlightAuto`` * ``relevance``: integer value representing the relevance score * ``value``: HTML string with highlighting markup * ``top``: top of the current mode stack * ``illegal``: boolean representing whether any illegal matches were found * ``code``: the original raw code highlightAuto ------------- :: highlightAuto(code, languageSubset) Highlighting with language detection. Accepts a string with the code to highlight and an optional array of language names and aliases restricting detection to only those languages. The subset can also be set with ``configure``, but the local parameter overrides the option if set. Returns an object with the following properties: * ``language``: detected language * ``relevance``: integer value representing the relevance score * ``value``: HTML string with highlighting markup * ``secondBest``: object with the same structure for second-best heuristically detected language (may be absent) highlightElement ---------------- :: highlightElement(element) Applies highlighting to a DOM node containing code. This function is the one to use to apply highlighting dynamically after page load or within initialization code of third-party JavaScript frameworks. The function uses language detection by default but you can specify the language in the ``class`` attribute of the DOM node. See the :doc:`scopes reference ` for all available language names and scopes. highlightAll ------------ Applies highlighting to all elements on a page matching the configured ``cssSelector``. The default ``cssSelector`` value is ``'pre code'``, which highlights all code blocks. This can be called before or after the page's ``onload`` event has fired. newInstance ----------- Returns a new instance of the highlighter with default configuration. configure --------- :: configure(options) Configures global options: * ``classPrefix``: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets. * ``languages``: an array of language names and aliases restricting auto detection to only these languages. * ``languageDetectRe``: a regex to configure how CSS class names map to language (allows class names like say `color-as-php` vs the default of `language-php`, etc.) * ``noHighlightRe``: a regex to configure which CSS classes are to be skipped completely. * ``cssSelector``: a CSS selector to configure which elements are affected by ``hljs.highlightAll``. Defaults to ``'pre code'``. * ``ignoreUnescapedHTML``: do not log warnings to console about unescaped HTML in code blocks * ``throwUnescapedHTML``: throw a ``HTMLInjectionError`` when ``highlightElement`` is asked to highlight content that includes unescaped HTML Accepts an object representing options with the values to updated. Other options don't change :: hljs.configure({ noHighlightRe: /^do-not-highlightme$/i, languageDetectRe: /\bgrammar-([\w-]+)\b/i, // for `grammar-swift` style CSS naming classPrefix: '' // don't append class prefix // … other options aren't changed }); registerLanguage ---------------- :: registerLanguage(languageName, languageDefinition) Adds new language to the library under the specified name. Used mostly internally. * ``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. unregisterLanguage ------------------ :: unregisterLanguage(languageName) Removes a language and its aliases from the library. Used mostly internally. * ``languageName``: a string with the name of the language being removed. registerAliases --------------- :: registerAliases(alias|aliases, {languageName}) Adds new language alias or aliases to the library for the specified language name defined under ``languageName`` key. * ``alias|aliases``: a string or array with the name of alias being registered * ``languageName``: the language name as specified by ``registerLanguage``. listLanguages ------------- Returns the languages names list. .. _getLanguage: getLanguage ----------- :: getLanguage(name) Looks up a language by name or alias. Returns the language object if found, ``undefined`` otherwise. versionString ------------- :: versionString Returns the full Highlight.js version as a string, ie: ``"11.0.1"``. safeMode -------- :: safeMode() Enables safe mode. This is the default mode, providing the most reliable experience for production usage. debugMode --------- :: debugMode() Enables *debug/development* mode. .. warning:: This mode purposely makes Highlight.js more fragile! It should only be used for testing and local development (of languages or the library itself). For example, if a new version suddenly had a serious bug (or breaking change) that affected only a single language: * **In Safe Mode** all other languages would continue to highlight just fine. The broken language would appear as a code block, but without any highlighting (as if it were plaintext). * **In Debug Mode** all highlighting would stop and a JavaScript error would be thrown. addPlugin --------- :: addPlugin(plugin) Add a plugin to this instance of Highlight.js. See the :doc:`plugin api ` for additional plugin information. removePlugin --------- :: removePlugin(plugin) Remove the specified plugin from this instance. ``plugin`` must be exactly the same object that was passed to ``addPlugin``. Deprecated API -------------- highlight ^^^^^^^^^ .. deprecated:: 10.7 This will be removed entirely in v12. :: highlight(languageName, code) Please see the :ref:`newer API` shown above. highlightBlock ^^^^^^^^^^^^^^ .. deprecated:: 11.0 Please use ``highlightElement()`` instead. initHighlighting ^^^^^^^^^^^^^^^^ .. deprecated:: 10.6 Please use ``highlightAll()`` instead. initHighlightingOnLoad ^^^^^^^^^^^^^^^^^^^^^^ .. deprecated:: 10.6 Please use ``highlightAll()`` instead. ================================================ FILE: docs/building-testing.rst ================================================ Building and Testing ==================== To use Highlight.js it is first necessary to build it for the environment where you plan to execute it: the browser, the Node.js server, etc. TLDR ---- Often when contributing a pull-request it's sufficient to build and test only the Node.js build. Our CI process will guarantee the browser build tests are all still green if you don't run them during development. :: npm run build npm run test The browser library must be built and tested separately: :: npm run build-browser npm run test-browser Building -------- The build tool is written in JavaScript using node.js. Before running the script, make sure to have node installed and run ``npm install`` to get the dependencies. The tool is located in ``tools/build.js``. A few useful examples: * Build for a browser using only common languages:: node tools/build.js :common * Build for node.js including all available languages:: node tools/build.js -t node * Build two specific languages for debugging, skipping compression in this case:: node tools/build.js -n python ruby On some systems the node binary is named ``nodejs``; simply replace ``node`` with ``nodejs`` in the examples above if that is the case. The full option reference is available with the usual ``--help`` option. The build result will be in the ``build/`` directory. .. _basic-testing: Basic testing ------------- The usual approach to debugging and testing a language is first doing it visually. You need to build highlight.js with only the language you're working on (without compression, to have readable code in browser error messages) and then use the Developer tool in ``tools/developer.html`` to see how it highlights a test snippet in that language. A test snippet should be short and give the idea of the overall look of the language. It shouldn't include every possible syntactic element and shouldn't even make practical sense. After you satisfied with the result you need to make sure that language detection still works with your language definition included in the whole suite. Testing is done using `Mocha `_ and the files are found in the ``test/`` directory. You can use the node build to run the tests from the command line with ``npm test`` after building_. (Using ``npm run build_and_test`` you can build and then test with one command.) **Note**: for Debian-based machine, like Ubuntu, you might need to create an alias or symbolic link for nodejs to node. The reason for this is the dependencies that are requires to test highlight.js has a reference to "node". Place the snippet you used inside the browser in ``test/detect//default.txt``, build the package with all the languages for node and run the test suite. If your language breaks auto-detection, it should be fixed by :ref:`improving relevance `, which is a black art in and of itself. When in doubt, please refer to the discussion group! Testing markup -------------- You can also provide additional markup tests for the language to test isolated cases of various syntactic construct. If your language has 19 different string literals or complicated heuristics for telling division (``/``) apart from regexes (``/ .. /``) -- this is the place. A test case consists of two files: * ``test/markup//.txt``: test code * ``test/markup//.expect.txt``: reference rendering To generate reference rendering use the Developer tool located at ``tools/developer.html``. Make sure to explicitly select your language in the drop-down menu, as automatic detection is unlikely to work in this case. Building and Testing with Docker -------------------------------- If you don't want to install dependencies on your system, you can use the included Dockerfile to build a container that will add the source code and then deploy a web server for you to preview it. Specifically, after you finish with your changes you can build the container from the root of the repository: :: docker build -t highlight-js . And then run the container. You will need to expose port 80 on the host for the web interface, and note that we are running it in detached (-d) mode. :: docker run -d --name highlight-js --rm -p 80:80 highlight-js If your preference is for another port, you can do that too: :: docker run -d --name highlight-js --rm -p 80:8080 highlight-js Or you can skip binding a port if your intention is to interactively shell into the container to use it as a development environment. :: docker run -d --name highlight-js --rm highlight-js Whatever you choose, you can use docker ps to ensure that it's running. :: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0e15a7c99adf highlight-js "docker-entrypoint.s…" 8 seconds ago Up 7 seconds 0.0.0.0:80->80/tcp highlight-js Then, open up to http://127.0.0.1/tools/developer.html to see the developer page for preview. When you are done, clean up your container. :: docker stop highlight-js If you want a more advanced testing setup, you can bind the source folder when you run the container. :: docker run -d --name highlight-js --volume $PWD/src:/var/www/html/src --rm -p 80:80 highlight-js Then if you want to make changes, you can do so locally (the folder is bound as a volume), and execute a command to the container to trigger a rebuild: :: docker exec highlight-js node tools/build.js :common And then reload the page to see changes. When you finish, don't forget to remove the container. ================================================ FILE: docs/conf.py ================================================ # -*- coding: utf-8 -*- # # highlight.js documentation build configuration file, created by # sphinx-quickstart on Wed Sep 12 23:48:27 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os import sphinx_rtd_theme import myst_parser # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ "sphinx_rtd_theme", "myst_parser" ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'highlight.js' copyright = u'2012–2024, Ivan Sagalaev' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # The full version, including alpha/beta/rc tags. release = '11.11.1' # The short X.Y version. version = ".".join(release.split(".")[:2]) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'highlightjsdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'highlightjs.tex', u'highlight.js Documentation', u'Ivan Sagalaev', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'highlightjs', u'highlight.js Documentation', [u'Ivan Sagalaev'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'highlightjs', u'highlight.js Documentation', u'Ivan Sagalaev', 'highlightjs', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' ================================================ FILE: docs/css-classes-reference.rst ================================================ Scope Reference =============== Stylable Scopes ---------------- The general purpose scopes are intended to be used for any language, but the other scopes may also be used when semantically correct. For example if you had a general purpose language that allowed inline URLs: :: var GOOGLE = https://www.google.com/ It would be reasonable to use the ``link`` class for this, even if your language is not a markup language. However, many themes might not be designed with this in mind so a better choice (for best theme support) might possibly be ``string``. +----------------------------------------------------------------------------------------+ | **General purpose** | +--------------------------+-------------------------------------------------------------+ | keyword | keyword in a regular Algol-style language | +--------------------------+-------------------------------------------------------------+ | built_in | built-in or library object (constant, class, | | | function) | +--------------------------+-------------------------------------------------------------+ | type | data type (in a language with syntactically | | | significant types) (``string``, ``int``, | | | ``array``, etc.) | +--------------------------+-------------------------------------------------------------+ | literal | special identifier for a built-in value | | | (``true``, ``false``, ``null``, etc.) | +--------------------------+-------------------------------------------------------------+ | number | number, including units and modifiers, if any. | +--------------------------+-------------------------------------------------------------+ | operator | operators: ``+``, ``-``, ``>>``, ``|``, ``==`` | +--------------------------+-------------------------------------------------------------+ | punctuation | aux. punctuation that should be subtly highlighted | | | (parentheses, brackets, etc.) | +--------------------------+-------------------------------------------------------------+ | property | object property ``obj.prop1.prop2.value`` | +--------------------------+-------------------------------------------------------------+ | regexp | literal regular expression | +--------------------------+-------------------------------------------------------------+ | string | literal string, character | +--------------------------+-------------------------------------------------------------+ | char.escape | an escape character such as ``\n`` | +--------------------------+-------------------------------------------------------------+ | subst | parsed section inside a literal string | +--------------------------+-------------------------------------------------------------+ | symbol | symbolic constant, interned string, goto label | +--------------------------+-------------------------------------------------------------+ | class | **deprecated** You probably want ``title.class`` | +--------------------------+-------------------------------------------------------------+ | function | **deprecated** You probably want ``title.function`` | +--------------------------+-------------------------------------------------------------+ | variable | variables | +--------------------------+-------------------------------------------------------------+ | variable.language | variable with special meaning in a language, e.g.: | | | ``this``, ``window``, ``super``, ``self``, etc. | +--------------------------+-------------------------------------------------------------+ | variable.constant | variable that is a constant value, ie ``MAX_FILES`` | +--------------------------+-------------------------------------------------------------+ | title | name of a class or a function | +--------------------------+-------------------------------------------------------------+ | title.class | name of a class (interface, trait, module, etc) | +--------------------------+-------------------------------------------------------------+ | title.class.inherited | name of class being inherited from, extended, etc. | +--------------------------+-------------------------------------------------------------+ | title.function | name of a function | +--------------------------+-------------------------------------------------------------+ | title.function.invoke | name of a function (when being invoked) | +--------------------------+-------------------------------------------------------------+ | params | block of function arguments (parameters) at the | | | place of declaration | +--------------------------+-------------------------------------------------------------+ | comment | comments | +--------------------------+-------------------------------------------------------------+ | doctag | documentation markup within comments, e.g. ``@params`` | +--------------------------+-------------------------------------------------------------+ | **Meta** | +--------------------------+-------------------------------------------------------------+ | meta | flags, modifiers, annotations, processing | | | instructions, preprocessor directives, etc | +--------------------------+-------------------------------------------------------------+ | meta.prompt | REPL or shell prompts or similar | +--------------------------+-------------------------------------------------------------+ | meta keyword | a keyword inside a meta block | | | (note this is nested, not subscoped) | +--------------------------+-------------------------------------------------------------+ | meta string | a string inside a meta block | | | (note this is nested, not subscoped) | +--------------------------+-------------------------------------------------------------+ | **Tags, attributes, configs** | +--------------------------+-------------------------------------------------------------+ | section | heading of a section in a config file, heading in | | | text markup | +--------------------------+-------------------------------------------------------------+ | tag | XML/HTML tag | +--------------------------+-------------------------------------------------------------+ | name | name of an XML tag, the first word in an | | | s-expression | +--------------------------+-------------------------------------------------------------+ | attr | name of an attribute with no language defined | | | semantics (keys in JSON, setting names in .ini), | | | also sub-attribute within another highlighted | | | object, like XML tag | +--------------------------+-------------------------------------------------------------+ | attribute | name of an attribute followed by a structured | | | value part, like CSS properties | +--------------------------+-------------------------------------------------------------+ | **Text Markup** | +--------------------------+-------------------------------------------------------------+ | bullet | list item bullet | +--------------------------+-------------------------------------------------------------+ | code | code block | +--------------------------+-------------------------------------------------------------+ | emphasis | emphasis | +--------------------------+-------------------------------------------------------------+ | strong | strong emphasis | +--------------------------+-------------------------------------------------------------+ | formula | mathematical formula | +--------------------------+-------------------------------------------------------------+ | link | hyperlink | +--------------------------+-------------------------------------------------------------+ | quote | quotation or blockquote | +--------------------------+-------------------------------------------------------------+ | **CSS** | +--------------------------+-------------------------------------------------------------+ | selector-tag | tag selector | +--------------------------+-------------------------------------------------------------+ | selector-id | #id selector | +--------------------------+-------------------------------------------------------------+ | selector-class | .class selector | +--------------------------+-------------------------------------------------------------+ | selector-attr | [attr] selector | +--------------------------+-------------------------------------------------------------+ | selector-pseudo | :pseudo selector | +--------------------------+-------------------------------------------------------------+ | **Templates** | +--------------------------+-------------------------------------------------------------+ | template-tag | tag of a template language | +--------------------------+-------------------------------------------------------------+ | template-variable | variable in a template language | +--------------------------+-------------------------------------------------------------+ | **diff** | +--------------------------+-------------------------------------------------------------+ | addition | added or changed line | +--------------------------+-------------------------------------------------------------+ | deletion | deleted line | +--------------------------+-------------------------------------------------------------+ A note on scopes with sub-scopes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some scope names above have a ``.`` in them. We use this notation to specify sub-scopes. In the generated HTML this will output multiple computed class names. The depth of nesting determines the number of underscores appended to sub-scope names. For example, Lets say the scope is ``title.class.other``. The CSS class names generated would be: - ``hljs-title`` - ``class_`` - ``other__`` The top-level scope is always the one that has the configured prefix applied. The generated HTML would be: :: Render A theme could then simply target that using the following CSS: .. code-block:: css .hljs-title.class_.other__ { color: blue; } A note on newer scopes ^^^^^^^^^^^^^^^^^^^^^^ Some scopes have been added more recently and do not enjoy universal theme support. For themes without support, these items will simply not be highlighted. This doesn't mean not to use them, only that they will be highlighted better as support improves over time. A list of these scopes: - operator - punctuation - property Reserved scopes ^^^^^^^^^^^^^^^ The below scopes (ReasonML) are left here for documentation purposes but may not be used in other grammars because they are very poorly supported by all themes. If you'd like to help out with the larger issue here: - https://github.com/highlightjs/highlight.js/issues/2521 - https://github.com/highlightjs/highlight.js/issues/2500 +--------------------------+---------------------------------------------------+ | **ReasonML** | +--------------------------+---------------------------------------------------+ | pattern-match | pattern matching matchers | +--------------------------+---------------------------------------------------+ | typing | type signatures on function parameters | +--------------------------+---------------------------------------------------+ | constructor | type constructors | +--------------------------+---------------------------------------------------+ | module-access | scope access into a module | +--------------------------+---------------------------------------------------+ | module | module reference within scope access | +--------------------------+---------------------------------------------------+ Language names and aliases -------------------------- The language names and aliases table has moved to `SUPPORTED_LANGUAGES.md `_. ================================================ FILE: docs/index.rst ================================================ .. highlight.js documentation master file, created by sphinx-quickstart on Wed Sep 12 23:48:27 2012. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Highlight.js Documentation ========================== .. toctree:: :caption: Getting Started :maxdepth: 1 README / How to Use building-testing Upgrading to Version 11 .. toctree:: :caption: Reference :maxdepth: 1 api plugin-api language-guide theme-guide mode-reference css-classes-reference plugin-recipes .. maintainers-guide .. toctree:: :caption: FAQ :titlesonly: :maxdepth: 0 Which languages are supported? Why no line numbers? How to request a new language? How to contribute a new language? Links ^^^^^ .. hlist:: - `Source `_ - `Issues `_ - `Discord `_ - `Website `_ - `highlight.js npm `_ - `@highlightjs/cdn-assets npm `_ ================================================ FILE: docs/language-contribution.rst ================================================ Language contributor checklist ============================== 1. Know that you are creating a 3rd party grammar ------------------------------------------------- *Sadly, due to lack of maintainer time we no longer merge new languages grammars into the core library.* Instead, the project works by encouraging 3rd party language grammar development by willing contributors ready to help and maintain them. We're also happy to host those 3rd party language grammars at the ``highlightjs`` GitHub organization. Or you're welcome to host yourself - we're always happy to link to to new language grammars. We also make it easy to build, maintain, and distribute 3rd party grammar modules so that Highlight.js can always be easily extended with new languages. Using a 3rd party language (for end users) is often as simple as just adding a single line of code to their JavaScript or build system. We'd love to have your grammar as a 3rd party language module if you'd be willing to maintain it over time. It's easy to develop and publish a 3rd party language module. If you already started work in the main source tree - it's trivial to convert your existing work into a 3rd party module. (you pretty much just move your files into a new project folder) 2. Read extra/3RD_PARTY_QUICK_START.md -------------------------------------- Next, read ``extra/3RD_PARTY_QUICK_START.md``. This should provide you with a very high-level overview of the steps for creating a third-party language grammar for Highlight.js. 3. Create a language grammar definition file -------------------------------------------- The file defines a function accepting a reference to the library and returning a language object. The library parameter (``hljs``) is useful to access common modes and regexps. You should not immediately call this function (you only need to export it). Calling it is handled by the build process and details differ for different build targets. :: export default function(hljs) { return { name: "Language Name", keywords: 'foo bar', contains: [ ..., hljs.NUMBER_MODE, ... ] } } The name of the file is used as a short language identifier and should be usable as a class name in HTML and CSS. Typically you'll place this file in your new grammar repository under ``my_new_grammar/src/languages/``. 4. Add language metadata ---------------------------- At the top of the file there is a specially formatted comment with meta data processed by a build system. Meta data format is simply key-value pairs each occupying its own line: :: /* Language: Superlanguage Requires: java.js, sql.js Author: John Smith Contributors: Mike Johnson <...@...>, Matt Wilson <...@...> Description: Some cool language definition Website: https://superlanguage.example.com */ ``Language`` — the only required header giving a human-readable language name. ``Requires`` — a list of other language files required for this language to work. This make it possible to describe languages that extend definitions of other ones. Required files aren't processed in any special way. The build system just makes sure that they will be in the final package in ``LANGUAGES`` object. The meaning of the other headers should be pretty obvious. 5. Create a code example ------------------------ The code example is used both to test language detection and for the demo page on https://highlightjs.org/. Put it in ``test/detect//default.txt``. Take inspiration from other languages in ``test/detect/`` and read :ref:`testing instructions ` for more details. 6. Write a class reference if your class uses custom classes ------------------------------------------------------------ A class reference document should typically be placed at the root of your language repository: ``css-class-reference.md`` Describe shortly names of all meaningful modes used in your language definition. Note: If you use custom classes please be aware that all the build-in themes are not going to support your custom classes and you should likely also distribute your own custom theme. 7. Request a repository at the ``highlightjs`` organization ----------------------------------------------------------- *This is optional.* Of course you are free to host your repository anywhere you would like. Request a new 3rd party grammar repository hosted in highlightjs with Issue Type `**Issue: Request a new 3rd party grammar repository** `_ 8. Create a pull request ------------------------ Submit a PR to add your language to `SUPPORTED_LANGUAGES.md `_. ================================================ FILE: docs/language-guide.rst ================================================ .. highlight:: javascript Language Definition Guide ========================= Highlighting overview --------------------- Programming language code consists of parts with different rules of parsing: keywords like ``for`` or ``if`` don't make sense inside strings, strings may contain backslash-escaped symbols like ``\"``, and comments usually don't contain anything interesting except the end of the comment. In Highlight.js such parts are called "modes". Each mode consists of: * starting condition * ending condition * list of contained sub-modes * lexing rules and keywords * …exotic stuff like another language inside a language The parser's work is to look for modes and their keywords. Upon finding them, it wraps them into the markup ``...`` and puts the name of the mode ("string", "comment", "number") or a keyword group name ("keyword", "literal", "built-in") as the span's class name. General syntax -------------- A language definition is a JavaScript object describing the default parsing mode for the language. This default mode contains sub-modes which in turn contain other sub-modes, effectively making the language definition a tree of modes. Here's an example: :: { case_insensitive: true, // language is case-insensitive keywords: 'for if while', contains: [ { scope: 'string', begin: '"', end: '"' }, hljs.COMMENT( '/\\*', // begin '\\*/', // end { contains: [ { scope: 'doc', begin: '@\\w+' } ] } ) ] } Usually the default mode accounts for the majority of the code and describes all language keywords. A notable exception here is XML in which a default mode is just a user text that doesn't contain any keywords, and most interesting parsing happens inside tags. Keywords -------- In the simple case language keywords can be defined with a string (space delimited) or array: :: { keywords: 'else for if while', // or with an array keywords: ['else', 'for', 'if', 'while'] } Some languages have different kinds of "keywords" that might not be called as such by the language spec but are very close to them from the point of view of a syntax highlighter. These are all sorts of "literals", "built-ins", "symbols" and such. To define such keyword groups, the attribute ``keywords`` becomes an object, each property of which defines its own group of keywords: :: { keywords: { keyword: 'else for if while', literal: ['false','true','null'], _relevance_only: 'one two three four' } } The group name becomes the class name in the generated markup, enabling different theming for different kinds of keywords. Any property starting with a ``_`` will only use those keywords to increase relevance, they will not be highlighted. To detect keywords, highlight.js breaks the processed chunk of code into separate words — a process called lexing. By default, "words" are matched with the regexp ``\w+``, and that works well for many languages. Different lexing rules can be defined by the magic ``$pattern`` attribute: :: { keywords: { $pattern: /-[a-z]+/, // allow keywords to begin with dash keyword: '-import -export' } } Note: The older ``lexemes`` setting has been deprecated in favor of using ``keywords.$pattern``. They are functionally identical. Sub-modes --------- Sub-modes are listed in the ``contains`` attribute: :: { keywords: '...', contains: [ hljs.QUOTE_STRING_MODE, hljs.C_LINE_COMMENT, { ... custom mode definition ... } ] } A mode can reference itself in the ``contains`` array by using a special keyword ``'self``'. This is commonly used to define nested modes: :: { scope: 'object', begin: /\{/, end: /\}/, contains: [hljs.QUOTE_STRING_MODE, 'self'] } Note: ``self`` may not be used in the root level ``contains`` of a language. The root level mode is special and may not be self-referential. Comments -------- To define custom comments it is recommended to use a built-in helper function ``hljs.COMMENT`` instead of describing the mode directly, as it also defines a few default sub-modes that improve language detection and do other nice things. Parameters for the function are: :: hljs.COMMENT( begin, // begin regex end, // end regex extra // optional object with extra attributes to override defaults // (for example {relevance: 0}) ) Markup generation ----------------- Modes usually generate actual highlighting markup — ```` elements with specific class names that are defined by the ``scope`` attribute: :: { contains: [ { scope: 'string', // ... other attributes }, { scope: 'number', // ... } ] } Scopes are not required to be unique; it's quite common to have several definitions with the same scope. For example, many languages have various syntaxes for strings, comments, etc… Sometimes modes are defined only to support specific parsing rules and aren't needed in the final markup. A classic example is an escaping sequence inside strings allowing them to contain an ending quote. :: { scope: 'string', begin: '"', end: '"', contains: [{begin: '\\\\.'}], } For such modes, the ``scope`` attribute should be omitted so they won't generate excessive markup. For a list of all supported scope names please see the :doc:`Scopes Reference `. Mode attributes --------------- Other useful attributes are defined in the :doc:`mode reference `. .. _relevance: Relevance --------- Highlight.js tries to automatically detect the language of a code fragment. The heuristics is essentially simple: it tries to highlight a fragment with all the language definitions and the one that yields most specific modes and keywords wins. The job of a language definition is to help this heuristics by hinting relative relevance (or irrelevance) of modes. This is best illustrated by example. Python has special kinds of strings defined by prefix letters before the quotes: ``r"..."``, ``u"..."``. If a code fragment contains such strings there is a good chance that it's in Python. So these string modes are given high relevance: :: { scope: 'string', begin: 'r"', end: '"', relevance: 10 } On the other hand, conventional strings in plain single or double quotes aren't specific to any language and it makes sense to bring their relevance to zero to lessen statistical noise: :: { scope: 'string', begin: '"', end: '"', relevance: 0 } The default value for relevance is always 1. When setting an explicit value typically either 10 or 0 is used. A 0 means this match should not be considered for language detection purposes. 0 should be used for very common matches that might be found in ANY language (basic numbers, strings, etc) or things that would otherwise create too many false positives. A 10 means "this is almost guaranteed to be XYZ code". 10 should be used sparingly. Keywords also influence relevance. Each of them usually has a relevance of 1, but there are some unique names that aren't likely to be found outside of their languages, even in the form of variable names. For example just having ``reinterpret_cast`` somewhere in the code is a good indicator that we're looking at C++. It's worth to set relevance of such keywords a bit higher. This is done with a pipe: :: { keywords: 'for if reinterpret_cast|10' } Illegal symbols --------------- Another way to improve language detection is to define illegal symbols for a mode. For example, in Python the first line of a class definition (``class MyClass(object):``) cannot contain the symbol ``{`` or a newline. The presence of these symbols clearly shows that the language is not Python, and the parser can drop this attempt early. Illegal symbols are defined using a single regular expression: :: { scope: 'class', illegal: '[${]' } Pre-defined modes and regular expressions ----------------------------------------- Many languages share common modes and regular expressions. These expressions are defined in `lib/modes.js `_ and should be used whenever possible. Regular Expression Features --------------------------- The goal of Highlight.js is to support whatever regex features our supported JavaScript runtimes universally support. You're using real regular expressions, use them responsibly. That said, due to the design of the parser, there are some caveats. These are addressed below. Things we fully support now that we did not always: * look-ahead regex matching for `begin` (#2135) * look-ahead regex matching for `end` (#2237) * look-ahead regex matching for `illegal` (#2135) * back-references within your regex matches (#1897) Things that technically would work, but we do not allow (because Safari does not support look-behind): * look-behind matching for `begin` (#2135) Things that are not supported because of issues with the parsing engine itself: * look-behind matching for `end` matchers Contributing ------------ Follow the :doc:`contributor checklist `. ================================================ FILE: docs/language-requests.rst ================================================ On requesting new languages =========================== This is a general answer to requests for adding new languages that appear from time to time in the Highlight.js issue tracker and discussion group. Highlight.js does not have a fundamental plan for implementing new languages - i.e., the core team doesn't usually develop new languages. The core team instead focuses on parser development, bugs, and supporting the existing languages. They also do not have time to review, merge, and maintain additional languages (fixing bugs, dealing with issues, etc). Instead, the project works by encouraging 3rd party language grammars from contributors willing to help develop and maintain them. We're also happy to host those 3rd party language grammars at the ``highlightjs`` GitHub organization - no matter how obscure or weird. Or you're welcome to host it yourself - we're still happy to link to it. This means that *there's no point in requesting a new language without also providing a 3rd party implementation* (we'll simply close "Please support language Xyz" issues with a link to this explanation). If you'd like to see a particular language supported, the best way forward is to build the grammar yourself, or find a developer interested in doing so. For more info on actually developing a language see our :doc:`language-guide`, and for information on how to properly package your 3rd party language module see :doc:`language-contribution`. ================================================ FILE: docs/line-numbers.rst ================================================ Line numbers ============ Highlight.js' notable lack of line numbers support is not an oversight but a feature. Following is an explanation from the original author: One of the defining design principles for Highlight.js from the start was simplicity. Not the simplicity of code (in fact, it's quite complex) but the simplicity of usage and of the actual look of highlighted snippets on HTML pages. Many highlighters, in my opinion, are overdoing it with such things as separate colors for every single type of lexemes, striped backgrounds, fancy buttons around code blocks and — yes — line numbers. The more fancy stuff resides around the code the more it distracts a reader from understanding it. This is why it's not a straightforward decision: this new feature will not just make Highlight.js better, it might actually make it worse simply by making it look more bloated in blog posts around the Internet. This is why I'm asking people to show that it's worth it. The only real use-case that ever was brought up in support of line numbers is referencing code from the descriptive text around it. On my own blog I was always solving this either with comments within the code itself or by breaking the larger snippets into smaller ones and describing each small part separately. I'm not saying that my solution is better. But I don't see how line numbers are better either. And the only way to show that they are better is to set up some usability research on the subject. I doubt anyone would bother to do it. Then there's maintenance. So far the core code of Highlight.js is maintained by only one person — yours truly. Inclusion of any new code in Highlight.js means that from that moment I will have to fix bugs in it, improve it further, make it work together with the rest of the code, defend its design. And I don't want to do all this for the feature that I consider "evil" and probably will never use myself. This doesn't stop anyone from forking the library or maintaining a line-numbers plugin. ================================================ FILE: docs/mode-reference.rst ================================================ .. highlight:: javascript Mode Reference ============== **Data Types** Types of attributes values in this reference: +------------+----------------------------------------------------------------------------+ | mode | A valid Highlight.js Mode (as defined by this very reference) | +------------+----------------------------------------------------------------------------+ | scope | A valid grammar scope: ``title.class.inherited`` | +------------+----------------------------------------------------------------------------+ | regexp | JavaScript regexp literal (recommended) or string representing a regexp. | | | | | | (note when using a string proper escaping is critical) | +------------+----------------------------------------------------------------------------+ | boolean | JavaScript boolean: ``true`` or ``false`` | +------------+----------------------------------------------------------------------------+ | string | JavaScript string | +------------+----------------------------------------------------------------------------+ | number | JavaScript number | +------------+----------------------------------------------------------------------------+ | object | JavaScript object: ``{ ... }`` | +------------+----------------------------------------------------------------------------+ | array | JavaScript array: ``[ ... ]`` | +------------+----------------------------------------------------------------------------+ Language Attributes ------------------- These attributes are only valid at the language level (ie, they many only exist on the top-most language object and have no meaning if specified in children modes). name ^^^^ - **type**: string The canonical name of this language, ie "JavaScript", etc. unicodeRegex ^^^^^^^^^^^^ - **type**: boolean Expresses whether the grammar in question uses Unicode (``u`` flag) regular expressions. (defaults to false) case_insensitive ^^^^^^^^^^^^^^^^ - **type**: boolean Case insensitivity of language keywords and regexps. Used only on the top-level mode. (defaults to false) aliases ^^^^^^^ - **type**: array of strings A list of additional names (besides the canonical one given by the filename) that can be used to identify a language in HTML classes and in a call to :ref:`getLanguage `. classNameAliases ^^^^^^^^^^^^^^^^ - **type**: object A mapping table of any custom scope names your grammar uses and their supported equivalencies. Perhaps your language has a concept of "slots" that roughly correspond to variables in other languages. This allows you to write grammar code like: :: { classNameAliases: { slot: "variable", "message-name": "string" }, contains: [ { scope: "slot", begin: // ... } ] } The final HTML output will render slots with a CSS class of ``hljs-variable``. This feature exists to make it easier for grammar maintainers to think in their own language when maintaining a grammar. For a list of all supported scope names please see the :doc:`Scopes Reference `. disableAutodetect ^^^^^^^^^^^^^^^^^ - **type**: boolean Disables autodetection for this language. (defaults to false, meaning auto-detect is enabled) __emitTokens ^^^^^^^^^^^^ .. warning:: **This is currently still private/beta API**, though it's expected to be fairly stable. It should land in version 12.0. Allows grammars to bundle custom parsers - bypassing the default parser and grammar mode definitions. This should be a function that accepts the raw source code as the first argument and an "Emitter" object as the second. A custom parser may parse the source as it sees fit - making calls to the Emitter along the way - allowing Highlight.js to generate and theme the final HTML. The **Emitter** API is trivial: - ``addText(text)`` - ``startScope(name)`` - ``endScope()`` Given: :: hello beautiful world! Assuming beautiful is a keyword our Emitter calls might look something like: :: addText("hello ") startScope("keyword") addText("beautiful") endScope() addText(" world!") Resulting in the following generated HTML: .. code-block:: html hello beautiful world! .. note:: The intended use of ``addText`` is larger chunks of plain text, not individual characters. Custom parsers should buffer plain text output into complete strings rather than sending output one character at a time. compilerExtensions ^^^^^^^^^^^^^^^^^^ .. warning:: **This is heavily dependent upon compiler internals and may NOT be stable from minor release to minor release.** *It is currently recommended only for 1st party grammars.* - **type**: an array of compiler extensions ie: ``(mode, parentMode) -> {}`` This allows grammars to extend the mode compiler to add their own syntactic sugar to make reading and writing grammars easier. The intention is that we use grammars to "test" out new compiler extensions and if they perform well promote them into the core library. mode The incoming mode object parentMode The parent mode of the mode (null for the top level language mode) For example lets look at a tiny well behaved extension to allow us to write ``match`` as sugar to better express the intent to "match a single thing, then end mode". :: compilerExtensions: [ (mode, _parentMode) => { // first some quick sanity checks if (!mode.match) return; // then check for users doing things that would make no sense if (mode.begin || mode.end) throw new Error("begin & end are not supported with match"); // copy the match regex into begin mode.begin = mode.match; // cleanup: delete our syntactic construct delete mode.match; } ] Compiler extension functions return nothing. They are expected to mutate the mode itself. Mode Attributes --------------- className ^^^^^^^^^ .. deprecated:: 11.0 Use ``scope`` instead. scope ^^^^^ .. versionadded:: 11.0 - **type**: scope The scope of a given mode. Scopes are converted to CSS class names in HTML markup. Multiple modes can have the same scope. This is useful when a language has multiple variants of syntax for one thing like string in single or double quotes. :: { scope: "title.function.call", begin: /[a-z]+\(/ } See :doc:`scopes reference` for details on scopes and CSS classes. begin ^^^^^ - **type**: regexp or array of regexp Regular expression starting a mode. For example a single quote for strings or two forward slashes for C-style comments. If absent, ``begin`` defaults to a regexp that matches anything, so the mode starts immediately. This may also be an array. See :ref:`beginScope`. .. _beginScope: beginScope ^^^^^^^^^^ .. versionadded:: 11.0 - **type**: scope - **type**: numeric index of scopes (when ``begin`` is an array) This can be used to apply a scope to just the begin match portion. :: { begin: /def/, beginScope: "keyword" } You can also use ``beginScope`` to individually highlight portions of the match with different scopes by passing an array to ``begin``. :: { begin: [ /function!/, /\s+/, hljs.IDENT_RE ], beginScope: { 1: "keyword", 3: "title" }, } This would highlight ``function!`` as a ``keyword`` while highlighting the name of the function as ``title``. The space(s) between would be matched, but not highlighted. Note: Internally, each regular expression in the array becomes a capture group inside a larger concatenated regex. If your regular expressions use capture groups (or references) they will be auto-magically renumerated so that they continue to work without any changes. For more info see issue `#3095 `_. endScope ^^^^^^^^ .. versionadded:: 11.0 - **type**: scope - **type**: numeric index of scopes (when ``end`` is an array) This has the same behavior as ``beginScope`` but applies to the content of the ``end`` match. :: { begin: /FIRST/, end: /LAST/, endScope: "built_in" } match ^^^^^ .. versionadded:: 11.0 - **type**: regexp or array of regexp This is simply syntactic sugar for a ``begin`` when no ``end`` expression is necessary. It may not be used with ``begin`` or ``end`` keys (that would make no sense). It exists simply to help make grammars more readable. :: { scope: "title", match: /Fish/ } This is equivalent to: :: { scope: "title", begin: /Fish/ } on:begin ^^^^^^^^ - **type**: callback (matchData, response) This callback is triggered the moment a begin match is detected. ``matchData`` includes the typical regex match data; the full match, match groups, etc. The ``response`` object is used to tell the parser how it should handle the match. It can be also used to temporarily store data. - ``response.data`` - a simple object data store. Can be used for building more complex rules where the end rule is dependent on the content of begin, etc. - ``response.ignoreMatch()`` - pretend as if this match never happened. The mode is not entered. Continues trying subsequent modes in the current mode's ``contains`` list For an example of usage see ``END_SAME_AS_BEGIN`` in ``modes.js``. end ^^^ - **type**: regexp Regular expression ending a mode. For example a single quote for strings or "$" (end of line) for one-line comments. It's often the case that a beginning regular expression defines the entire mode and doesn't need any special ending. For example a number can be defined with ``begin: "\\b\\d+"`` which spans all the digits. If absent, ``end`` defaults to a regexp that matches anything, so the mode ends immediately (after possibly matching any ``contains`` sub-modes). Sometimes a mode can end not by itself but implicitly with its containing (parent) mode. This is achieved with :ref:`endsWithParent ` attribute. on:end ^^^^^^ - **type**: callback (matchData, response) This callback is triggered the moment an end match is detected. ``matchData`` includes the typical regex match data; the full match, match groups, etc. The ``response`` object is used to tell the parser how it should handle the match. It can also be used to retrieve data stored from a `begin` callback. - ``response.data`` - a simple object data store. Can be used for building more complex rules where the end rule is dependent on the content of begin, etc. - ``response.ignoreMatch()`` - pretend as if this match never happened. The mode is not entered. Continues trying subsequent modes in the current mode's ``contains`` list For an example of usage see ``END_SAME_AS_BEGIN`` in ``modes.js``. beginKeywords ^^^^^^^^^^^^^ - **type**: string Used instead of ``begin`` for modes starting with keywords to avoid needless repetition: :: { begin: '\\b(class|interface)\\b', keywords: 'class interface' } … can often be shortened to: :: { beginKeywords: 'class interface' } Unlike the :ref:`keywords ` attribute, this one allows only a simple list of space separated keywords. If you do need additional features of ``keywords`` or you just need more keywords for this mode you may include ``keywords`` along with ``beginKeywords``. .. note:: ``beginKeywords`` also checks for a ``.`` before or after the keywords and will fail to match if one is found. This is to avoid false positives for method calls or property accesses. Ex. ``class A { ... }`` would match while ``A.class == B.class`` would not. .. _endsWithParent: endsWithParent ^^^^^^^^^^^^^^ - **type**: boolean A flag indicating that a mode ends when its parent ends. This is best demonstrated by example. In CSS syntax a selector has a set of rules contained within symbols "{" and "}". Individual rules are separated by ";" but the last rule may omit the terminating semicolon: :: p { width: 100%; color: red } A simple ``end: /;/`` rule is problematic - the parser could get "stuck" looking for a ``;`` that it will never find (or find much later) - skipping over valid content that should be highlighted. This is where ``endsWithParent`` proves useful: :: { scope: 'rules', begin: /\{/, end: /\}/, contains: [ {scope: 'rule', /* ... */ end: ';', endsWithParent: true} ] } The ``rule`` scope now will end when the parser sees *either* a ``;`` or a ``}`` (from the parent). .. _endsParent: endsParent ^^^^^^^^^^^^^^ - **type**: boolean Forces closing of the parent mode right after the current mode is closed. This is used for modes that don't have an easily expressible ending lexeme but instead could be closed after the last interesting sub-mode is found. Here's an example with two ways of defining functions in Elixir, one using a keyword ``do`` and another using a comma: :: def foo :clear, list do :ok end def foo, do: IO.puts "hello world" Note that in the first case the parameter list after the function title may also include a comma. And if we're only interested in highlighting a title we can tell it to end the function definition after itself: :: { scope: 'function', beginKeywords: 'def', end: hljs.MATCH_NOTHING_RE, contains: [ { scope: 'title', begin: hljs.IDENT_RE, endsParent: true } ] } The ``end: hljs.MATCH_NOTHING_RE`` ensures that function will never end itself. .. _keywords: keywords ^^^^^^^^ - **type**: object / string / array *Keyword definition comes in three forms.* A string of space-separated keywords with an optional relevance following a pipe (``|``): :: 'for while if|0 else weird_voodoo|10 ...' An array of keywords (with optional relevance following a ``|``): :: [ "for", "while", "if|0" ] .. note:: It's recommended that the array form be used (one keyword per line) rather than a string to simplify future maintenance. This is the style followed by grammars part of the core library. An object that describing multiple sets of keywords and (optionally) the pattern used to locate them: :: { keyword: [ 'for', 'while', 'if|0' ], literal: [ 'true', 'false' ], $pattern: /\w+/ } For a more detailed explanation see :doc:`Language definition guide `. illegal ^^^^^^^ - **type**: regexp or array A regular expression or array that defines symbols illegal for the mode. When the parser finds an illegal match it may immediately stop parsing the whole language altogether (see ``ignoreIllegals``). Smart use of illegal can greatly improve auto-detection by quickly ruling out a language (when an illegal match is found). :: { illegal: /%/, // or using an array illegal: [ /%/, /cookies/ ] } excludeBegin, excludeEnd ^^^^^^^^^^^^^^^^^^^^^^^^ - **type**: boolean Excludes beginning or ending matches from a mode's content. For example in CSS syntax a rule ends with a semicolon. However visually it's better not to consider the semicolon as part of the rule's contents. Using ``excludeEnd: true`` forces a ```` element for the rule to close before the semicolon. The semicolon is still consumed by the rule though and cannot be matched by other subsequent rules. (it's effectively been skipped over) returnBegin ^^^^^^^^^^^ - **type**: boolean Returns just found beginning lexeme back into parser. This is used when beginning of a sub-mode is a complex expression that should not only be found within a parent mode but also parsed according to the rules of a sub-mode. .. warning:: Since the parser is effectively goes back it's quite possible to create a infinite loop here so use with caution! A look-ahead regex is almost always preferable. returnEnd ^^^^^^^^^ - **type**: boolean Returns just found ending lexeme back into parser. This is used for example to parse JavaScript embedded into HTML. A JavaScript block ends with the HTML closing tag ```` that cannot be parsed with JavaScript rules. So it is returned back into its parent HTML mode that knows what to do with it. .. warning:: Since the parser is effectively goes back it's quite possible to create a infinite loop here so use with caution! A look-ahead regex is almost always preferable. contains ^^^^^^^^ - **type**: array The list of sub-modes that can be found inside the mode. For detailed explanation see :doc:`Language definition guide `. starts ^^^^^^ - **type**: mode The the mode that will start right after the current mode ends. The new mode will not be contained within the current one. Currently this attribute is used to highlight JavaScript and CSS contained within HTML. Tags ``

Title

================================================ FILE: test/detect/xml/groovy-julia.txt ================================================ ================================================ FILE: test/detect/xml/js.txt ================================================ ================================================ FILE: test/detect/xquery/default.txt ================================================ xquery version "3.1"; (:~ : @author Duncan Paterson : @version 1.0:) declare variable $local:num := math:log10(12345); ( let $map := map { 'R': 'red', 'G': 'green', 'B': 'blue' } return ( $map?* (: 1. returns all values; same as: map:keys($map) ! $map(.) :), $map?R (: 2. returns the value associated with the key 'R'; same as: $map('R') :), $map?('G','B') (: 3. returns the values associated with the key 'G' and 'B' :) ), declare function local:city($country as node()*) as element (country) { for $country in doc('factbook')//country where $country/@population > 100000000 let $name := $country/name[1] for $city in $country//city[population gt 1000000] group by $name return element country { attribute type { $name }, $city/name } }; return ('A', 'B', 'C') => count(), {local:city(.) + $local:num} ================================================ FILE: test/detect/yaml/default.txt ================================================ --- # comment string_1: "Bar" string_2: 'bar' string_3: bar inline_keys_ignored: sompath/name/file.jpg keywords_in_yaml: - true - false - TRUE - FALSE - 21 - 21.0 - !!str 123 "quoted_key": &foobar bar: foo foo: "foo": bar reference: *foobar multiline_1: | Multiline String multiline_2: > Multiline String multiline_3: " Multiline string " ansible_variables: "foo {{variable}}" array_nested: - a - b: 1 c: 2 - b - comment ================================================ FILE: test/detect/zephir/default.txt ================================================ function testBefore( a, var b = 5, int c = 10) { a->method1(); return b + c; } namespace Test; use RuntimeException as RE; /** * Example comment */ class Test extends CustomClass implements TestInterface { const C1 = null; // Magic constant: http://php.net/manual/ru/language.constants.predefined.php const className = __CLASS__; public function method1() { int a = 1, b = 2; if likely a > b { a++; } else if unlikely b < a { a--; } return a + b; } // See fn is allowed like shortcut public fn method2() -> { call_user_func(function() { echo "hello"; }); [1, 2, 3, 4, 5]->walk( function(int! x) { return x * x; } ); [1, 2, 3, 4, 5]->walk( function(_, int key) { echo key; } ); array input = [1, 2, 3, 4, 5]; input->walk( function(_, int key) { echo key; } ); input->map(x => x * x); return this; } } ================================================ FILE: test/fixtures/expect/endsWithParentVariants.txt ================================================ ( [ ( ) ] ) ================================================ FILE: test/fixtures/expect/explicit1.txt ================================================ for x in [1, 2, 3]: count(x) ================================================ FILE: test/fixtures/expect/explicit2.txt ================================================ @import "compass/reset"; $colorGreenDark: #393; ================================================ FILE: test/fixtures/expect/languagealias.txt ================================================ var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>'; ================================================ FILE: test/fixtures/expect/sublanguages.txt ================================================ <? echo 'php'; /* ?> */ ?> <body> <script>document.write('Legacy code');</script> </body> ================================================ FILE: test/fixtures/expect/useBr.txt ================================================ <head>
<meta charset="utf-8">
<title></title>
</head> ================================================ FILE: test/fixtures/index.html ================================================ highlight.js test
for x in [1, 2, 3]:
  count(x)
for x in [1, 2, 3]:
  count(x)
for x in [1, 2, 3]:
  count(x)
@import "compass/reset";
$colorGreenDark: #393;
@import "compass/reset";
$colorGreenDark: #393;
var x = '<p>this should <b>not</b> be highlighted as <em>HTML</em>';
<div id="contents">
  <p>Hello, World!
</div>
<div id="contents">
  <p>Hello, World!
</div>
Computer output
for x in [1, 2, 3]: count(x)
for x in [1, 2, 3]: count(x)
for x in [1, 2, 3]: count(x)
<? echo 'php'; /* ?> */ ?>
<body>
<script>document.write('Legacy code');</script>
</body>
<?xml version="1.0"?>
    <response value="ok" xml:lang="en"></response>
<?xml version="1.0"?>
    <response value="ok" xml:lang="en"></response>
<?xml version="1.0"?>
    <response value="ok" xml:lang="en"></response>
<?xml version="1.0"?>
    <response value="ok" xml:lang="en"></response>
( [ ( ) ] )
================================================ FILE: test/fixtures/nested.js ================================================ module.exports = function(hljs) { var BODY = { className: 'body', endsWithParent: true }; var LIST = { className: 'list', variants: [ {begin: /\(/, end: /\)/}, {begin: /\[/, end: /\]/} ], contains: [BODY] }; BODY.contains = [LIST]; return { disableAutodetect: true, contains: [LIST] } }; ================================================ FILE: test/index.js ================================================ 'use strict'; const hljs = require('../build'); hljs.debugMode(); // tests run in debug mode so errors are raised // Tests specific to the API exposed inside the hljs object. // Right now, that only includes tests for several common regular expressions. require('./api'); // Test weird bugs we've fixed over time require("./parser"); // Tests for auto detection of languages via `highlightAuto`. require('./detect'); // HTML markup tests for particular languages. Usually when there is an // incorrect highlighting of one language, once the bug get fixed, the // expected markup will be added into the `test/markup` folder to keep // theses highlighting errors from cropping up again. require('./markup'); // check regex for fatal issues like exponential backtracking, etc require('./regex'); // Tests meant for the browser only. Using the `test/fixtures/index.html` file // along with `jsdom` these tests check for things like: custom markup already // existing in the code being highlighted, blocks that disable highlighting, // and several other cases. Do note that the `test/fixtures/index.html` file // isn't actually used to test inside a browser but `jsdom` acts as a virtual // browser inside of node.js and runs together with all the other tests. require('./special'); ================================================ FILE: test/markup/1c/default.expect.txt ================================================ #ЗагрузитьИзФайла ext_module.txt // директива 7.7 #Если Клиент ИЛИ НаКлиенте Тогда // инструкции препроцессора &НаКлиентеНаСервереБезКонтекста // директивы компиляции Функция ТолстыйКлиентОбычноеПриложение(Знач Параметр1 = Неопределено, // комментарий Параметр2 = "", ПараметрN = 123.45, ПарамNN) Экспорт // еще комментарий Попытка Результат_Булевы_Значения = Новый Структура("П1, П2", Истина, Ложь, NULL, Неопределено); Перейти ~МеткаGOTO; // комментарий РезультатТаблицаДат = Новый ТаблицаЗначений; РезультатТаблицаДат.Колонки.Добавить("Колонка1", Новый ОписаниеТипов("Дата", , , Новый КвалификаторыДаты(ЧастиДаты.ДатаВремя)); НС = РезультатТаблицаДат.Добавить(); НС["Колонка1"] = '20170101120000'); Исключение ОписаниеОшибки = ОписаниеОшибки(); // встроенная функция Масс = Новый Массив; // встроенный тип Для Каждого Значение Из Масс Цикл Сообщить(Значение + Символы.ПС + " |продолжение строки"); // продолжение многострочной строки Продолжить; Прервать; КонецЦикла; СправочникСсылка = Справочники.Языки.НайтиПоНаименованию("ru"); // встроенные типы СправочникОбъект = СправочникСсылка.ПолучитьОбъект(); ПеречислениеСсылка = Перечисления.ВидыМодификацииДанных.Изменен; ВызватьИсключение ОписаниеОшибки; КонецПопытки; ~МеткаGOTO: // еще комментарий ВД = ВидДвиженияБухгалтерии.Дебет; КонецФункции // ТолстыйКлиентОбычноеПриложение() #КонецЕсли ================================================ FILE: test/markup/1c/default.txt ================================================ #ЗагрузитьИзФайла ext_module.txt // директива 7.7 #Если Клиент ИЛИ НаКлиенте Тогда // инструкции препроцессора &НаКлиентеНаСервереБезКонтекста // директивы компиляции Функция ТолстыйКлиентОбычноеПриложение(Знач Параметр1 = Неопределено, // комментарий Параметр2 = "", ПараметрN = 123.45, ПарамNN) Экспорт // еще комментарий Попытка Результат_Булевы_Значения = Новый Структура("П1, П2", Истина, Ложь, NULL, Неопределено); Перейти ~МеткаGOTO; // комментарий РезультатТаблицаДат = Новый ТаблицаЗначений; РезультатТаблицаДат.Колонки.Добавить("Колонка1", Новый ОписаниеТипов("Дата", , , Новый КвалификаторыДаты(ЧастиДаты.ДатаВремя)); НС = РезультатТаблицаДат.Добавить(); НС["Колонка1"] = '20170101120000'); Исключение ОписаниеОшибки = ОписаниеОшибки(); // встроенная функция Масс = Новый Массив; // встроенный тип Для Каждого Значение Из Масс Цикл Сообщить(Значение + Символы.ПС + " |продолжение строки"); // продолжение многострочной строки Продолжить; Прервать; КонецЦикла; СправочникСсылка = Справочники.Языки.НайтиПоНаименованию("ru"); // встроенные типы СправочникОбъект = СправочникСсылка.ПолучитьОбъект(); ПеречислениеСсылка = Перечисления.ВидыМодификацииДанных.Изменен; ВызватьИсключение ОписаниеОшибки; КонецПопытки; ~МеткаGOTO: // еще комментарий ВД = ВидДвиженияБухгалтерии.Дебет; КонецФункции // ТолстыйКлиентОбычноеПриложение() #КонецЕсли ================================================ FILE: test/markup/abnf/default.expect.txt ================================================ ; line comment ruleset = [optional] *(group1 / group2 / SP) CRLF ; trailing comment group1 = alt1 group1 =/ alt2 alt1 = %x41-4D / %d78-90 alt2 = %b00100001 group2 = *1DIGIT / 2*HEXDIG / 3*4OCTET a optional = hex-codes / literal / sensitive / insensitive hex-codes = %x68.65.6C.6C.6F literal = "string literal" sensitive = %s"case-sensitive string" insensitive = %i"case-insensitive string" ================================================ FILE: test/markup/abnf/default.txt ================================================ ; line comment ruleset = [optional] *(group1 / group2 / SP) CRLF ; trailing comment group1 = alt1 group1 =/ alt2 alt1 = %x41-4D / %d78-90 alt2 = %b00100001 group2 = *1DIGIT / 2*HEXDIG / 3*4OCTET a optional = hex-codes / literal / sensitive / insensitive hex-codes = %x68.65.6C.6C.6F literal = "string literal" sensitive = %s"case-sensitive string" insensitive = %i"case-insensitive string" ================================================ FILE: test/markup/accesslog/default.expect.txt ================================================ 20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" 127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 192.168.2.20 - - [28/Jul/2006:10:27:10 -0300] "GET /cgi-bin/try/ HTTP/1.0" 200 3395 127.0.0.90 - - [13/Sep/2006:07:00:53 -0700] "PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1" 401 587 66.249.78.17 – – [13/Jul/2015:07:18:58 -0400] "GET /robots.txt HTTP/1.1" 200 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" ================================================ FILE: test/markup/accesslog/default.txt ================================================ 20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1" 127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 192.168.2.20 - - [28/Jul/2006:10:27:10 -0300] "GET /cgi-bin/try/ HTTP/1.0" 200 3395 127.0.0.90 - - [13/Sep/2006:07:00:53 -0700] "PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1" 401 587 66.249.78.17 – – [13/Jul/2015:07:18:58 -0400] "GET /robots.txt HTTP/1.1" 200 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" ================================================ FILE: test/markup/actionscript/method-call.expect.txt ================================================ x.get(0); ================================================ FILE: test/markup/actionscript/method-call.txt ================================================ x.get(0); ================================================ FILE: test/markup/ada/default.expect.txt ================================================ package body Sqlite.Simple is Foo : int := int'Size; Bar : int := long'Size; Error_Message_C : chars_ptr := Sqlite_Errstr (Error); Error_Message : String := Null_Ignore_Value (Error_Message_C); begin Named : parallel for Index in Foo..Bar loop Put ("Hi[]{}"); end loop Named; Foo := Bar; end Message; end Sqlite.Simple; ================================================ FILE: test/markup/ada/default.txt ================================================ package body Sqlite.Simple is Foo : int := int'Size; Bar : int := long'Size; Error_Message_C : chars_ptr := Sqlite_Errstr (Error); Error_Message : String := Null_Ignore_Value (Error_Message_C); begin Named : parallel for Index in Foo..Bar loop Put ("Hi[]{}"); end loop Named; Foo := Bar; end Message; end Sqlite.Simple; ================================================ FILE: test/markup/angelscript/default.expect.txt ================================================ interface IInterface { void DoSomething(); } namespace MyApplication { /* * This ia a test class. */ class SomeClass : IInterface { array<float> m_arr; array<SomeClass@> m_children; array<array<SomeClass@>> m_subChildren; // Nested templates int m_thing; uint64 m_thing2; SomeClass() { // Add some integers m_arr.insertLast(1.0f); m_arr.insertLast(1.75f); m_arr.insertLast(3.14159f); uint x = 0x7fff0000; int y = 9001; uint z = 0b10101010; } int get_Thing() property { return m_thing; } void set_Thing(int x) property { m_thing = x; } [Hook x=1 y=2] void DoSomething() { print("Something! " + 'stuff.'); for (uint i = 0; i < m_arr.length(); i++) { print(" " + i + ": " + m_arr[i]); } } protected void SomeProtectedFunction() { try { DoSomething(); } catch { print("Exception while doing something!"); } } } } void Main() { SomeClass@ c = SomeClass(); c.DoSomething(); } string multilineString = """ Hello world, "this is a test"! """; ================================================ FILE: test/markup/angelscript/default.txt ================================================ interface IInterface { void DoSomething(); } namespace MyApplication { /* * This ia a test class. */ class SomeClass : IInterface { array m_arr; array m_children; array> m_subChildren; // Nested templates int m_thing; uint64 m_thing2; SomeClass() { // Add some integers m_arr.insertLast(1.0f); m_arr.insertLast(1.75f); m_arr.insertLast(3.14159f); uint x = 0x7fff0000; int y = 9001; uint z = 0b10101010; } int get_Thing() property { return m_thing; } void set_Thing(int x) property { m_thing = x; } [Hook x=1 y=2] void DoSomething() { print("Something! " + 'stuff.'); for (uint i = 0; i < m_arr.length(); i++) { print(" " + i + ": " + m_arr[i]); } } protected void SomeProtectedFunction() { try { DoSomething(); } catch { print("Exception while doing something!"); } } } } void Main() { SomeClass@ c = SomeClass(); c.DoSomething(); } string multilineString = """ Hello world, "this is a test"! """; ================================================ FILE: test/markup/apache/default.expect.txt ================================================ # rewrite`s rules for wordpress pretty url LoadModule rewrite_module modules/mod_rewrite.so RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [NC,L] ExpiresActive On ExpiresByType application/x-javascript "access plus 1 days" Order Deny,Allow Allow from All <Location /maps/> RewriteMap map txt:map.txt RewriteMap lower int:tolower RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC] RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L] </Location> ================================================ FILE: test/markup/apache/default.txt ================================================ # rewrite`s rules for wordpress pretty url LoadModule rewrite_module modules/mod_rewrite.so RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [NC,L] ExpiresActive On ExpiresByType application/x-javascript "access plus 1 days" Order Deny,Allow Allow from All RewriteMap map txt:map.txt RewriteMap lower int:tolower RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC] RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L] ================================================ FILE: test/markup/applescript/default.expect.txt ================================================ repeat 5 times if foo is greater than bar then display dialog "Hello there" else beep end if end repeat (* comment (*nested comment*) *) on do_something(s, y) return {s + pi, y mod 4} end do_something do shell script "/bin/echo 'hello'" ================================================ FILE: test/markup/applescript/default.txt ================================================ repeat 5 times if foo is greater than bar then display dialog "Hello there" else beep end if end repeat (* comment (*nested comment*) *) on do_something(s, y) return {s + pi, y mod 4} end do_something do shell script "/bin/echo 'hello'" ================================================ FILE: test/markup/arcade/profile.expect.txt ================================================ /* Isolated test for the most recent version */ function offsetPopulation(offset){ var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); return popDensity; } Distance($feedfeature, $originalFeature); var startDate = DateOnly(1996,11,10); var endDate = DateOnly(); var age = DateDiff(endDate, startDate, 'years'); Floor(age); var natlPizzaDay = Date(2024, 1, 9, 0, 0, 0, 0, "America/Los_Angeles"); TimeZone(natlPizzaDay); var n = 0; for(var i=1; i<100; i++) { if (i % 2 == 1) { continue; } n+=i; } return n; var a = [2,4,6,8,10]; var total = 0; for (var v of a) { total += v; } var result = DistanceToCoordinate($userInput, 1038); return result.coordinate.x + total; ================================================ FILE: test/markup/arcade/profile.txt ================================================ /* Isolated test for the most recent version */ function offsetPopulation(offset){ var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") ); var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} }); var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]); return popDensity; } Distance($feedfeature, $originalFeature); var startDate = DateOnly(1996,11,10); var endDate = DateOnly(); var age = DateDiff(endDate, startDate, 'years'); Floor(age); var natlPizzaDay = Date(2024, 1, 9, 0, 0, 0, 0, "America/Los_Angeles"); TimeZone(natlPizzaDay); var n = 0; for(var i=1; i<100; i++) { if (i % 2 == 1) { continue; } n+=i; } return n; var a = [2,4,6,8,10]; var total = 0; for (var v of a) { total += v; } var result = DistanceToCoordinate($userInput, 1038); return result.coordinate.x + total; ================================================ FILE: test/markup/arduino/default.expect.txt ================================================ /* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } ================================================ FILE: test/markup/arduino/default.txt ================================================ /* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ // Pin 13 has an LED connected on most Arduino boards. // give it a name: int led = 13; // the setup routine runs once when you press reset: void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second } ================================================ FILE: test/markup/armasm/default.expect.txt ================================================ //=================== YOUR CODE GOES HERE ===================// # logical operator demo (highlight.js arm comment test) mov r0, #0x00F0 // r0 = 0x00F0 mov r1, #0x000F // r1 = 0x000F mov r2, #0xFF00 // r2 = 0xFF00 # and even more code, but indented orr r3, r0, r1 // r3 = r0 | r1 // r3 = 0x00FF and r4, r3, r2 // r4 = r3 & r2 // r4 = 0x0000 orr r5, r3, r2 // r4 = r3 | r2 // r5 = 0xFFFF eor r6, r5, r2 // r6 = r5 ^ r2 // r6 = 0x00FF //===========================================================================// ================================================ FILE: test/markup/armasm/default.txt ================================================ //=================== YOUR CODE GOES HERE ===================// # logical operator demo (highlight.js arm comment test) mov r0, #0x00F0 // r0 = 0x00F0 mov r1, #0x000F // r1 = 0x000F mov r2, #0xFF00 // r2 = 0xFF00 # and even more code, but indented orr r3, r0, r1 // r3 = r0 | r1 // r3 = 0x00FF and r4, r3, r2 // r4 = r3 & r2 // r4 = 0x0000 orr r5, r3, r2 // r4 = r3 | r2 // r5 = 0xFFFF eor r6, r5, r2 // r6 = r5 ^ r2 // r6 = 0x00FF //===========================================================================// ================================================ FILE: test/markup/asciidoc/constrained.expect.txt ================================================ bold *constrained* text. italic _constrained_ text. monospace `constrained` text. Some strong [#strong]*word*. The word \*stars* is not rendered as bold text. Use the * symbol. Read the footnotes*. You can also type* this symbol *. A strong *wo rd*. Not a strong *wo rd*. \\blah blah *blah*. \\blah blah blah*. Does *Bob -love- Gemma*? Does *Bob "love" Gemma*? Does *Bob love Gemma? Truly?* There's a colon:*directly* before the starting formatting mark. There's a semi-colon directly before the starting formatting mark &ndash;*2018* There's a closing curly bracket directly {before}*the starting formatting mark*. *bl*ck*-eye E = mc*2* E = *mc*2 The parser is working *99%* of the time *bob knows very best* *does bob -really- know best?* Some emphasis on [#emphasis]_that_. The word \_underscore_ is not rendered as italic. Use the _ symbol. Read the footnotes_. You can also type_ this symbol _. An important _wo rd_. Not an important _wo rd_. \\blah blah _blah_. \\blah blah blah_. Does _Bob -love- Gemma_? Does _Bob "love" Gemma_? Does _Bob love Gemma? Truly?_ There's a colon:_directly_ before the starting formatting mark. There's a semi-colon directly before the starting formatting mark &ndash;_2018_ There's a closing curly bracket directly {before}_the starting formatting mark_. _bl_ck_-eye E = mc_2_ E = _mc_2 The parser is working _99%_ of the time _bob knows very best_ _does bob -really- know best?_ ================================================ FILE: test/markup/asciidoc/constrained.txt ================================================ bold *constrained* text. italic _constrained_ text. monospace `constrained` text. Some strong [#strong]*word*. The word \*stars* is not rendered as bold text. Use the * symbol. Read the footnotes*. You can also type* this symbol *. A strong *wo rd*. Not a strong *wo rd*. \\blah blah *blah*. \\blah blah blah*. Does *Bob -love- Gemma*? Does *Bob "love" Gemma*? Does *Bob love Gemma? Truly?* There's a colon:*directly* before the starting formatting mark. There's a semi-colon directly before the starting formatting mark –*2018* There's a closing curly bracket directly {before}*the starting formatting mark*. *bl*ck*-eye E = mc*2* E = *mc*2 The parser is working *99%* of the time *bob knows very best* *does bob -really- know best?* Some emphasis on [#emphasis]_that_. The word \_underscore_ is not rendered as italic. Use the _ symbol. Read the footnotes_. You can also type_ this symbol _. An important _wo rd_. Not an important _wo rd_. \\blah blah _blah_. \\blah blah blah_. Does _Bob -love- Gemma_? Does _Bob "love" Gemma_? Does _Bob love Gemma? Truly?_ There's a colon:_directly_ before the starting formatting mark. There's a semi-colon directly before the starting formatting mark –_2018_ There's a closing curly bracket directly {before}_the starting formatting mark_. _bl_ck_-eye E = mc_2_ E = _mc_2 The parser is working _99%_ of the time _bob knows very best_ _does bob -really- know best?_ ================================================ FILE: test/markup/asciidoc/default.expect.txt ================================================ Hello, World! ============ Author Name, <author@domain.foo> you can write text http://example.com[with links], optionally using an explicit link:http://example.com[link prefix]. * single quotes around a phrase place 'emphasis' ** alternatively, you can put underlines around a phrase to add _emphasis_ * astericks around a phrase make the text *bold* * pluses around a phrase make it +monospaced+ * `smart' quotes using a leading backtick and trailing single quote ** use two of each for double ``smart'' quotes - escape characters are supported - you can escape a quote inside emphasized text like 'here\'s johnny!' term:: definition another term:: another definition // this is just a comment Let's make a break. ''' //// we'll be right with you after this brief interruption. //// == We're back! Want to see a image::images/tiger.png[Tiger]? .Nested highlighting ++++ <this_is inline="xml"></this_is> ++++ ____ asciidoc is so powerful. ____ another quote: [quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes] ____ When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth. ____ Getting Literal --------------- want to get literal? prefix a line with a space. .... I'll join that party, too. .... . one thing (yeah!) . two thing `i can write code`, and `more` wipee! = Document Title (Level 0) == Level 1 Section Title === Level 2 Section Title ==== Level 3 Section Title ===== Level 4 Section Title ====== Level 5 Section Title // symmetric Atx-style sections & headings = Document Title (Level 0) = == Level 1 Section Title == === Level 2 Section Title === ==== Level 3 Section Title ==== ===== Level 4 Section Title ===== ====== Level 5 Section Title ====== NOTE: AsciiDoc is quite cool, you should try it. ================================================ FILE: test/markup/asciidoc/default.txt ================================================ Hello, World! ============ Author Name, you can write text http://example.com[with links], optionally using an explicit link:http://example.com[link prefix]. * single quotes around a phrase place 'emphasis' ** alternatively, you can put underlines around a phrase to add _emphasis_ * astericks around a phrase make the text *bold* * pluses around a phrase make it +monospaced+ * `smart' quotes using a leading backtick and trailing single quote ** use two of each for double ``smart'' quotes - escape characters are supported - you can escape a quote inside emphasized text like 'here\'s johnny!' term:: definition another term:: another definition // this is just a comment Let's make a break. ''' //// we'll be right with you after this brief interruption. //// == We're back! Want to see a image::images/tiger.png[Tiger]? .Nested highlighting ++++ ++++ ____ asciidoc is so powerful. ____ another quote: [quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes] ____ When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth. ____ Getting Literal --------------- want to get literal? prefix a line with a space. .... I'll join that party, too. .... . one thing (yeah!) . two thing `i can write code`, and `more` wipee! = Document Title (Level 0) == Level 1 Section Title === Level 2 Section Title ==== Level 3 Section Title ===== Level 4 Section Title ====== Level 5 Section Title // symmetric Atx-style sections & headings = Document Title (Level 0) = == Level 1 Section Title == === Level 2 Section Title === ==== Level 3 Section Title ==== ===== Level 4 Section Title ===== ====== Level 5 Section Title ====== NOTE: AsciiDoc is quite cool, you should try it. ================================================ FILE: test/markup/asciidoc/unconstrained.expect.txt ================================================ bold **un**constrained text. italic __un__constrained text. monospace ``un``constrained text. A sentence ** with words, and more words! using bold style :)**. Read the little notes**. Read the little notes** This is **bold** E = **mc**2 **Bob went with *Sarah* to the market today.** **Bob went with *Sarah* to the market today.** There's a colon:**directly** before the starting formatting mark. There's a semi-colon directly before the starting formatting mark &ndash;**2018** There's a closing curly bracket directly {before}**the starting formatting mark**. **--anything goes ** \\**--anything goes ** \\**--anything goes ** with * a **lot** of stars** **Git**Hub **bl*ck**-eye Git[.blue]**Hub** **bob knows very best** A sentence __ with words, and more words! using italic style :)__. Read the little notes__. Read the little notes__ This is __italic__ E = __mc__2 __Bob went with _Sarah_ to the market today.__ __Bob went with _Sarah_ to the market today.__ There's a colon:__directly__ before the starting formatting mark. There's a semi-colon directly before the starting formatting mark &ndash;__2018__ There's a closing curly bracket directly {before}__the starting formatting mark__. __--anything goes __ \\__--anything goes __ \\__--anything goes __ with _ a __lot__ of underscores__ __Git__Hub __bl_ck__-eye Git[.blue]__Hub__ __bob knows very best__ ================================================ FILE: test/markup/asciidoc/unconstrained.txt ================================================ bold **un**constrained text. italic __un__constrained text. monospace ``un``constrained text. A sentence ** with words, and more words! using bold style :)**. Read the little notes**. Read the little notes** This is **bold** E = **mc**2 **Bob went with *Sarah* to the market today.** **Bob went with *Sarah* to the market today.** There's a colon:**directly** before the starting formatting mark. There's a semi-colon directly before the starting formatting mark –**2018** There's a closing curly bracket directly {before}**the starting formatting mark**. **--anything goes ** \\**--anything goes ** \\**--anything goes ** with * a **lot** of stars** **Git**Hub **bl*ck**-eye Git[.blue]**Hub** **bob knows very best** A sentence __ with words, and more words! using italic style :)__. Read the little notes__. Read the little notes__ This is __italic__ E = __mc__2 __Bob went with _Sarah_ to the market today.__ __Bob went with _Sarah_ to the market today.__ There's a colon:__directly__ before the starting formatting mark. There's a semi-colon directly before the starting formatting mark –__2018__ There's a closing curly bracket directly {before}__the starting formatting mark__. __--anything goes __ \\__--anything goes __ \\__--anything goes __ with _ a __lot__ of underscores__ __Git__Hub __bl_ck__-eye Git[.blue]__Hub__ __bob knows very best__ ================================================ FILE: test/markup/aspectj/intertype-constructor.expect.txt ================================================ public MyClass.new() throws Exception{ // intertype constructor body } ================================================ FILE: test/markup/aspectj/intertype-constructor.txt ================================================ public MyClass.new() throws Exception{ // intertype constructor body } ================================================ FILE: test/markup/aspectj/intertype-method.expect.txt ================================================ public void MyClass.doSomething() throws Exception{ // intertype method body } public void A.doSomething(int param1){ // intertype method body } ================================================ FILE: test/markup/aspectj/intertype-method.txt ================================================ public void MyClass.doSomething() throws Exception{ // intertype method body } public void A.doSomething(int param1){ // intertype method body } ================================================ FILE: test/markup/autohotkey/default.expect.txt ================================================ ; hotkeys and hotstrings #a::WinSet, AlwaysOnTop, Toggle, A #Space:: MsgBox, Percent sign (`%) need to be escaped. Run "C:\Program Files\some\program.exe" Gosub, label1 return ::btw::by the way ; volume #Numpad8::Send {Volume_Up} #Numpad5::Send {Volume_Mute} #Numpad2::Send {Volume_Down} label1: if (Clipboard = "") { MsgBox, , Clipboard, Empty! } else { StringReplace, temp, Clipboard, old, new, All MsgBox, , Clipboard, %temp% } return ================================================ FILE: test/markup/autohotkey/default.txt ================================================ ; hotkeys and hotstrings #a::WinSet, AlwaysOnTop, Toggle, A #Space:: MsgBox, Percent sign (`%) need to be escaped. Run "C:\Program Files\some\program.exe" Gosub, label1 return ::btw::by the way ; volume #Numpad8::Send {Volume_Up} #Numpad5::Send {Volume_Mute} #Numpad2::Send {Volume_Down} label1: if (Clipboard = "") { MsgBox, , Clipboard, Empty! } else { StringReplace, temp, Clipboard, old, new, All MsgBox, , Clipboard, %temp% } return ================================================ FILE: test/markup/autoit/default.expect.txt ================================================ #NoTrayIcon #AutoIt3Wrapper_Run_Tidy=Y #include <Misc.au3> _Singleton(@ScriptName) ; Allow only one instance example(0, 10) Func example($min, $max) For $i = $min To $max If Mod($i, 2) == 0 Then MsgBox(64, "Message", $i & ' is even number!') Else MsgBox(64, "Message", $i & ' is odd number!') EndIf Next EndFunc ;==>example ================================================ FILE: test/markup/autoit/default.txt ================================================ #NoTrayIcon #AutoIt3Wrapper_Run_Tidy=Y #include _Singleton(@ScriptName) ; Allow only one instance example(0, 10) Func example($min, $max) For $i = $min To $max If Mod($i, 2) == 0 Then MsgBox(64, "Message", $i & ' is even number!') Else MsgBox(64, "Message", $i & ' is odd number!') EndIf Next EndFunc ;==>example ================================================ FILE: test/markup/avrasm/default.expect.txt ================================================ ;* Title: Block Copy Routines ;* Version: 1.1 .include "8515def.inc" rjmp RESET ;reset handle .def flashsize=r16 ;size of block to be copied flash2ram: lpm ;get constant st Y+,r0 ;store in SRAM and increment Y-pointer adiw ZL,1 ;increment Z-pointer dec flashsize brne flash2ram ;if not end of table, loop more ret .def ramtemp =r1 ;temporary storage register .def ramsize =r16 ;size of block to be copied ================================================ FILE: test/markup/avrasm/default.txt ================================================ ;* Title: Block Copy Routines ;* Version: 1.1 .include "8515def.inc" rjmp RESET ;reset handle .def flashsize=r16 ;size of block to be copied flash2ram: lpm ;get constant st Y+,r0 ;store in SRAM and increment Y-pointer adiw ZL,1 ;increment Z-pointer dec flashsize brne flash2ram ;if not end of table, loop more ret .def ramtemp =r1 ;temporary storage register .def ramsize =r16 ;size of block to be copied ================================================ FILE: test/markup/awk/default.expect.txt ================================================ BEGIN { POPService = "/inet/tcp/0/emailhost/pop3" RS = ORS = "\r\n" print "user name" |& POPService POPService |& getline print "pass password" |& POPService POPService |& getline print "retr 1" |& POPService POPService |& getline if ($1 != "+OK") exit print "quit" |& POPService RS = "\r\n\\.\r\n" POPService |& getline print $0 close(POPService) } ================================================ FILE: test/markup/awk/default.txt ================================================ BEGIN { POPService = "/inet/tcp/0/emailhost/pop3" RS = ORS = "\r\n" print "user name" |& POPService POPService |& getline print "pass password" |& POPService POPService |& getline print "retr 1" |& POPService POPService |& getline if ($1 != "+OK") exit print "quit" |& POPService RS = "\r\n\\.\r\n" POPService |& getline print $0 close(POPService) } ================================================ FILE: test/markup/axapta/default.expect.txt ================================================ class ExchRateLoadBatch extends RunBaseBatch { ExchRateLoad rbc; container currencies; boolean actual; boolean overwrite; date beg; date end; #define.CurrentVersion(5) #localmacro.CurrentList currencies, actual, beg, end #endmacro } public boolean unpack(container packedClass) { container base; boolean ret; Integer version = runbase::getVersion(packedClass); switch (version) { case #CurrentVersion: [version, #CurrentList] = packedClass; return true; default: return false; } return ret; } ================================================ FILE: test/markup/axapta/default.txt ================================================ class ExchRateLoadBatch extends RunBaseBatch { ExchRateLoad rbc; container currencies; boolean actual; boolean overwrite; date beg; date end; #define.CurrentVersion(5) #localmacro.CurrentList currencies, actual, beg, end #endmacro } public boolean unpack(container packedClass) { container base; boolean ret; Integer version = runbase::getVersion(packedClass); switch (version) { case #CurrentVersion: [version, #CurrentList] = packedClass; return true; default: return false; } return ret; } ================================================ FILE: test/markup/bash/arithmetic.expect.txt ================================================ echo $(( 16#deadbeef / 1003 )) yumi=deadbeef 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 )) ================================================ FILE: test/markup/bash/arithmetic.txt ================================================ echo $(( 16#deadbeef / 1003 )) yumi=deadbeef 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 )) ================================================ FILE: test/markup/bash/escaped-apos.expect.txt ================================================ # Escaped apostrophe is not a string echo \'not-a-highlighted-string\' ================================================ FILE: test/markup/bash/escaped-apos.txt ================================================ # Escaped apostrophe is not a string echo \'not-a-highlighted-string\' ================================================ FILE: test/markup/bash/escaped-quote.expect.txt ================================================ # Escaped double-quote is not a string echo '"quoted"' | tr -d \" > text.txt ================================================ FILE: test/markup/bash/escaped-quote.txt ================================================ # Escaped double-quote is not a string echo '"quoted"' | tr -d \" > text.txt ================================================ FILE: test/markup/bash/no-numbers.expect.txt ================================================ # numbers aren't highlighted in bash as their semantics is # not strictly defined for command line parameters $ tail -10 access.log ================================================ FILE: test/markup/bash/no-numbers.txt ================================================ # numbers aren't highlighted in bash as their semantics is # not strictly defined for command line parameters $ tail -10 access.log ================================================ FILE: test/markup/bash/not-comments.expect.txt ================================================ echo asdf#qwert yuiop echo asdf #qwert yuiop ================================================ FILE: test/markup/bash/not-comments.txt ================================================ echo asdf#qwert yuiop echo asdf #qwert yuiop ================================================ FILE: test/markup/bash/strings.expect.txt ================================================ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls" ROOT_DIR="$SCRIPT_DIR/.." jshell -s - << EOF System.out.printf("Procs: %s%n", getdata()) EOF jshell -s - <<<'System.out.printf("Procs: %s%n", getdata())' cat <<< '$VARIABLE' cat <<< "$VARIABLE" cat <<< $VARIABLE cat <<< `$VARIABLE` ================================================ FILE: test/markup/bash/strings.txt ================================================ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls" ROOT_DIR="$SCRIPT_DIR/.." jshell -s - << EOF System.out.printf("Procs: %s%n", getdata()) EOF jshell -s - <<<'System.out.printf("Procs: %s%n", getdata())' cat <<< '$VARIABLE' cat <<< "$VARIABLE" cat <<< $VARIABLE cat <<< `$VARIABLE` ================================================ FILE: test/markup/bash/token-containing-keyword.expect.txt ================================================ # a keyword as part of an option mycmd --disable-foo # a keyword as part of a parameter some-cmd set-some-setting some-cmd set_some_setting # a keyword as part of command check-case foo check_case foo ================================================ FILE: test/markup/bash/token-containing-keyword.txt ================================================ # a keyword as part of an option mycmd --disable-foo # a keyword as part of a parameter some-cmd set-some-setting some-cmd set_some_setting # a keyword as part of command check-case foo check_case foo ================================================ FILE: test/markup/bash/variables.expect.txt ================================================ $A ${B} ${WURST:-${CARNE}} ================================================ FILE: test/markup/bash/variables.txt ================================================ $A ${B} ${WURST:-${CARNE}} ================================================ FILE: test/markup/basic/default.expect.txt ================================================ 10 CLS 20 FOR I = 0 TO 15 22 FOR J = 0 TO 7 30 COLOR I,J 40 PRINT " ** "; 45 NEXT J 46 COLOR I,0 47 GOSUB 100 48 PRINT 50 NEXT I 60 COLOR 15,0 99 END 100 FOR T = 65 TO 90 101 PRINT CHR$(T); 102 NEXT T 103 RETURN 200 REM Data types test 201 TOTAL# = 3.30# 'Double precision variable 202 BALANCE! = 3! 'Single precision variable 203 B2! = 12e5 '120000 204 ITEMS% = 10 'Integer variable 205 HEXTEST = &H12DB 'Hex value ================================================ FILE: test/markup/basic/default.txt ================================================ 10 CLS 20 FOR I = 0 TO 15 22 FOR J = 0 TO 7 30 COLOR I,J 40 PRINT " ** "; 45 NEXT J 46 COLOR I,0 47 GOSUB 100 48 PRINT 50 NEXT I 60 COLOR 15,0 99 END 100 FOR T = 65 TO 90 101 PRINT CHR$(T); 102 NEXT T 103 RETURN 200 REM Data types test 201 TOTAL# = 3.30# 'Double precision variable 202 BALANCE! = 3! 'Single precision variable 203 B2! = 12e5 '120000 204 ITEMS% = 10 'Integer variable 205 HEXTEST = &H12DB 'Hex value ================================================ FILE: test/markup/bnf/default.expect.txt ================================================ <syntax> ::= <rule> | <rule> <syntax> <rule> ::= <opt-whitespace> "<" <rule-name> ">" <opt-whitespace> "::=" <opt-whitespace> <expression> <line-end> <opt-whitespace> ::= " " <opt-whitespace> | "" <expression> ::= <list> | <list> <opt-whitespace> "|" <opt-whitespace> <expression> <line-end> ::= <opt-whitespace> <EOL> | <line-end> <line-end> <list> ::= <term> | <term> <opt-whitespace> <list> <term> ::= <literal> | "<" <rule-name> ">" <literal> ::= '"' <text> '"' | "'" <text> "'" ================================================ FILE: test/markup/bnf/default.txt ================================================ ::= | ::= "<" ">" "::=" ::= " " | "" ::= | "|" ::= | ::= | ::= | "<" ">" ::= '"' '"' | "'" "'" ================================================ FILE: test/markup/brainfuck/default.expect.txt ================================================ ++++++++++ [ 3*10 and 10*10 ->+++>++++++++++<< ]>> [ filling cells ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[</]<[<]<[<]>> ]< +++++++++<< [ rough codes correction loop ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< ] more accurate сodes correction >>>++> -->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> ++>+++++++++++>++++++++++++>------>+++ rewind and output [<]>[.>] ================================================ FILE: test/markup/brainfuck/default.txt ================================================ ++++++++++ [ 3*10 and 10*10 ->+++>++++++++++<< ]>> [ filling cells ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[> ]< +++++++++<< [ rough codes correction loop ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]< ] more accurate сodes correction >>>++> -->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++> ++>+++++++++++>++++++++++++>------>+++ rewind and output [<]>[.>] ================================================ FILE: test/markup/c/number-literals.expect.txt ================================================ /* Floating-point literals. */ // Decimal. 1. +12. 1.2 1234e56 // Hexadecimal. 0x1p2 +0x1.p2 -0X1A.P2 0x1.Ap2 // Literal suffixes. 1.F /* Integer literals. */ // Binary. +0b1 // Note: Not standard C, but valid in some compilers 0B01 // Note: Not standard C, but valid in some compilers // Hexadecimal. +0x1 0X1A // Octal. +01 012 // Decimal. 0 +1 12 // Literal suffixes. 0X2L 0x2l 03LL 03ll 4UL 4Ul 4uL 4ul 5LU 5Lu 5lU 5lu 6ULL 6Ull 6uLL 6ull 7LLU 7LLu 7llU 7llu // Character array. char word[] = { '3', '\0' }; ================================================ FILE: test/markup/c/number-literals.txt ================================================ /* Floating-point literals. */ // Decimal. 1. +12. 1.2 1234e56 // Hexadecimal. 0x1p2 +0x1.p2 -0X1A.P2 0x1.Ap2 // Literal suffixes. 1.F /* Integer literals. */ // Binary. +0b1 // Note: Not standard C, but valid in some compilers 0B01 // Note: Not standard C, but valid in some compilers // Hexadecimal. +0x1 0X1A // Octal. +01 012 // Decimal. 0 +1 12 // Literal suffixes. 0X2L 0x2l 03LL 03ll 4UL 4Ul 4uL 4ul 5LU 5Lu 5lU 5lu 6ULL 6Ull 6uLL 6ull 7LLU 7LLu 7llU 7llu // Character array. char word[] = { '3', '\0' }; ================================================ FILE: test/markup/cal/default.expect.txt ================================================ OBJECT Codeunit 11 Gen. Jnl.-Check Line { OBJECT-PROPERTIES { Date=09-09-14; Time=12:00:00; Version List=NAVW18.00; } PROPERTIES { TableNo=81; Permissions=TableData 252=rimd; OnRun=BEGIN GLSetup.GET; RunCheck(Rec); END; } CODE { VAR Text000@1000 : TextConst 'ENU=can only be a closing date for G/L entries'; Text001@1001 : TextConst 'ENU=is not within your range of allowed posting dates'; PROCEDURE ErrorIfPositiveAmt@2(GenJnlLine@1000 : Record 81); BEGIN IF GenJnlLine.Amount > 0 THEN GenJnlLine.FIELDERROR(Amount,Text008); END; LOCAL PROCEDURE CheckGenJnlLineDocType@7(GenJnlLine@1001 : Record 81); } } ================================================ FILE: test/markup/cal/default.txt ================================================ OBJECT Codeunit 11 Gen. Jnl.-Check Line { OBJECT-PROPERTIES { Date=09-09-14; Time=12:00:00; Version List=NAVW18.00; } PROPERTIES { TableNo=81; Permissions=TableData 252=rimd; OnRun=BEGIN GLSetup.GET; RunCheck(Rec); END; } CODE { VAR Text000@1000 : TextConst 'ENU=can only be a closing date for G/L entries'; Text001@1001 : TextConst 'ENU=is not within your range of allowed posting dates'; PROCEDURE ErrorIfPositiveAmt@2(GenJnlLine@1000 : Record 81); BEGIN IF GenJnlLine.Amount > 0 THEN GenJnlLine.FIELDERROR(Amount,Text008); END; LOCAL PROCEDURE CheckGenJnlLineDocType@7(GenJnlLine@1001 : Record 81); } } ================================================ FILE: test/markup/capnproto/default.expect.txt ================================================ @0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id` struct Person { name @0 :Text; birthdate @3 :Date; email @1 :Text; phones @2 :List(PhoneNumber); struct PhoneNumber { number @0 :Text; type @1 :Type; enum Type { mobile @0; home @1; work @2; } } } struct Date { year @0 :Int16; month @1 :UInt8; day @2 :UInt8; flags @3 :List(Bool) = [ true, false, false, true ]; } interface Node { isDirectory @0 () -> (result :Bool); } interface Directory extends(Node) { list @0 () -> (list: List(Entry)); struct Entry { name @0 :Text; node @1 :Node; } create @1 (name :Text) -> (file :File); mkdir @2 (name :Text) -> (directory :Directory) open @3 (name :Text) -> (node :Node); delete @4 (name :Text); link @5 (name :Text, node :Node); } interface File extends(Node) { size @0 () -> (size: UInt64); read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff) -> (data: Data); # Default params = read entire file. write @2 (startAt :UInt64, data :Data); truncate @3 (size :UInt64); } ================================================ FILE: test/markup/capnproto/default.txt ================================================ @0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id` struct Person { name @0 :Text; birthdate @3 :Date; email @1 :Text; phones @2 :List(PhoneNumber); struct PhoneNumber { number @0 :Text; type @1 :Type; enum Type { mobile @0; home @1; work @2; } } } struct Date { year @0 :Int16; month @1 :UInt8; day @2 :UInt8; flags @3 :List(Bool) = [ true, false, false, true ]; } interface Node { isDirectory @0 () -> (result :Bool); } interface Directory extends(Node) { list @0 () -> (list: List(Entry)); struct Entry { name @0 :Text; node @1 :Node; } create @1 (name :Text) -> (file :File); mkdir @2 (name :Text) -> (directory :Directory) open @3 (name :Text) -> (node :Node); delete @4 (name :Text); link @5 (name :Text, node :Node); } interface File extends(Node) { size @0 () -> (size: UInt64); read @1 (startAt :UInt64 = 0, amount :UInt64 = 0xffffffffffffffff) -> (data: Data); # Default params = read entire file. write @2 (startAt :UInt64, data :Data); truncate @3 (size :UInt64); } ================================================ FILE: test/markup/ceylon/nested-comments.expect.txt ================================================ /* /* Ceylon has nested comments. */ */ ================================================ FILE: test/markup/ceylon/nested-comments.txt ================================================ /* /* Ceylon has nested comments. */ */ ================================================ FILE: test/markup/clean/default.expect.txt ================================================ module fsieve import StdClass; // RWS import StdInt, StdReal NrOfPrimes :== 3000 primes :: [Int] primes = pr where pr = [5 : sieve 7 4 pr] sieve :: Int !Int [Int] -> [Int] sieve g i prs | isPrime prs g (toInt (sqrt (toReal g))) = [g : sieve` g i prs] | otherwise = sieve (g + i) (6 - i) prs sieve` :: Int Int [Int] -> [Int] sieve` g i prs = sieve (g + i) (6 - i) prs isPrime :: [Int] !Int Int -> Bool isPrime [f:r] pr bd | f>bd = True | pr rem f==0 = False | otherwise = isPrime r pr bd select :: [x] Int -> x select [f:r] 1 = f select [f:r] n = select r (n - 1) Start :: Int Start = select [2, 3 : primes] NrOfPrimes ================================================ FILE: test/markup/clean/default.txt ================================================ module fsieve import StdClass; // RWS import StdInt, StdReal NrOfPrimes :== 3000 primes :: [Int] primes = pr where pr = [5 : sieve 7 4 pr] sieve :: Int !Int [Int] -> [Int] sieve g i prs | isPrime prs g (toInt (sqrt (toReal g))) = [g : sieve` g i prs] | otherwise = sieve (g + i) (6 - i) prs sieve` :: Int Int [Int] -> [Int] sieve` g i prs = sieve (g + i) (6 - i) prs isPrime :: [Int] !Int Int -> Bool isPrime [f:r] pr bd | f>bd = True | pr rem f==0 = False | otherwise = isPrime r pr bd select :: [x] Int -> x select [f:r] 1 = f select [f:r] n = select r (n - 1) Start :: Int Start = select [2, 3 : primes] NrOfPrimes ================================================ FILE: test/markup/clojure/character.expect.txt ================================================ \A \a \formfeed \u00DF \o303 ================================================ FILE: test/markup/clojure/character.txt ================================================ \A \a \formfeed \u00DF \o303 ================================================ FILE: test/markup/clojure/comment-macro.expect.txt ================================================ (comment "comment is a macro that emits no code. It can contain clojure code in itself.") (comment-and-something "This is a valid function name") ================================================ FILE: test/markup/clojure/comment-macro.txt ================================================ (comment "comment is a macro that emits no code. It can contain clojure code in itself.") (comment-and-something "This is a valid function name") ================================================ FILE: test/markup/clojure/deps_edn.expect.txt ================================================ {:aliases {:export {:exec-fn stelcodes.dev-blog.generator/export}, :repl {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.2"}, nrepl/nrepl {:mvn/version "0.8.3"}}, :extra-paths ["dev"], :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]" "--interactive"]}, :webhook {:exec-fn stelcodes.dev-blog.webhook/listen}}, :deps {http-kit/http-kit {:mvn/version "2.5.3"}, org.clojure/clojure {:mvn/version "1.10.1"}, stasis/stasis {:mvn/version "2.5.1"}}, :paths ["src" "resources"]} ================================================ FILE: test/markup/clojure/deps_edn.txt ================================================ {:aliases {:export {:exec-fn stelcodes.dev-blog.generator/export}, :repl {:extra-deps {cider/cider-nrepl {:mvn/version "0.25.2"}, nrepl/nrepl {:mvn/version "0.8.3"}}, :extra-paths ["dev"], :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]" "--interactive"]}, :webhook {:exec-fn stelcodes.dev-blog.webhook/listen}}, :deps {http-kit/http-kit {:mvn/version "2.5.3"}, org.clojure/clojure {:mvn/version "1.10.1"}, stasis/stasis {:mvn/version "2.5.1"}}, :paths ["src" "resources"]} ================================================ FILE: test/markup/clojure/globals_definition.expect.txt ================================================ (ns playground (:require [clojure.string :as str])) ; function (defn clojure-function [args] (let [string "multiline\nstring" regexp #"regexp" number 100000 booleans [false true] keyword ::the-keyword] ;; this is comment (if true (->> (list [vector] {:map map} #{'set}))))) #"\"abc\\" "real multiline string" #:person{:first "Han" :last "Solo" :ship #:ship{:name "Millenium Falcon"}} #::{:a 1, :b 2} ; global (def some-var) ; another one (def alternative-var "132") ; defonce (defonce ^:private another-var #"foo") ; private function (defn- add [x y] (+ x y)) ; protocols (defprotocol Fly "A simple protocol for flying" (fly [this] "Method to fly")) (defrecord Bird [name species] Fly (fly [this] (str (:name this) " flies..."))) ; multimethods (defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)])) (defmethod service-charge [::acc/Basic ::acc/Checking] [_] 25) (defmethod service-charge [::acc/Basic ::acc/Savings] [_] 10) (defmethod service-charge [::acc/Premium ::acc/Account] [_] 0) ; macros (defmacro unless [pred a b] `(if (not ~pred) ~a ~b)) (unless false (println "Will print") (println "Will not print")) ; types (deftype Circle [radius]) (deftype Square [length width]) ;; multimethods again (defmulti area class) (defmethod area Circle [c] (* Math/PI (* (.radius c) (.radius c)))) (defmethod area Square [s] (* (.length s) (.width s))) ;; create a couple shapes and get their area (def myCircle (Circle. 10)) (def mySquare (Square. 5 11)) ================================================ FILE: test/markup/clojure/globals_definition.txt ================================================ (ns playground (:require [clojure.string :as str])) ; function (defn clojure-function [args] (let [string "multiline\nstring" regexp #"regexp" number 100000 booleans [false true] keyword ::the-keyword] ;; this is comment (if true (->> (list [vector] {:map map} #{'set}))))) #"\"abc\\" "real multiline string" #:person{:first "Han" :last "Solo" :ship #:ship{:name "Millenium Falcon"}} #::{:a 1, :b 2} ; global (def some-var) ; another one (def alternative-var "132") ; defonce (defonce ^:private another-var #"foo") ; private function (defn- add [x y] (+ x y)) ; protocols (defprotocol Fly "A simple protocol for flying" (fly [this] "Method to fly")) (defrecord Bird [name species] Fly (fly [this] (str (:name this) " flies..."))) ; multimethods (defmulti service-charge (fn [acct] [(account-level acct) (:tag acct)])) (defmethod service-charge [::acc/Basic ::acc/Checking] [_] 25) (defmethod service-charge [::acc/Basic ::acc/Savings] [_] 10) (defmethod service-charge [::acc/Premium ::acc/Account] [_] 0) ; macros (defmacro unless [pred a b] `(if (not ~pred) ~a ~b)) (unless false (println "Will print") (println "Will not print")) ; types (deftype Circle [radius]) (deftype Square [length width]) ;; multimethods again (defmulti area class) (defmethod area Circle [c] (* Math/PI (* (.radius c) (.radius c)))) (defmethod area Square [s] (* (.length s) (.width s))) ;; create a couple shapes and get their area (def myCircle (Circle. 10)) (def mySquare (Square. 5 11)) ================================================ FILE: test/markup/clojure/number.expect.txt ================================================ ; integer 00 42 +42 -42 ; BigInt 42N 0N +42N -42N ; octal 052 00N +052 -00N ; hex 0x2a 0x0N +0x2a -0x0N ; radix 2r101010 8r52 16r2a 36r16 -2r101010 +36r16 ; radix BigInt 2r101010N 8r52N 16r2aN 36r16N +8r52N -16r2aN ;; ratios 1/2 -1/2 +123/224 ;; floats 42.0 -42.0 +42.0 42. +42. -42. ; BigDecimal 42.0M -42M 42.M 42M ; with Exponent 42.0E2 -42.0E+9 42E-0 +42E-0 42.0E2M 42E+9M -42E+9M +42.0E2M ================================================ FILE: test/markup/clojure/number.txt ================================================ ; integer 00 42 +42 -42 ; BigInt 42N 0N +42N -42N ; octal 052 00N +052 -00N ; hex 0x2a 0x0N +0x2a -0x0N ; radix 2r101010 8r52 16r2a 36r16 -2r101010 +36r16 ; radix BigInt 2r101010N 8r52N 16r2aN 36r16N +8r52N -16r2aN ;; ratios 1/2 -1/2 +123/224 ;; floats 42.0 -42.0 +42.0 42. +42. -42. ; BigDecimal 42.0M -42M 42.M 42M ; with Exponent 42.0E2 -42.0E+9 42E-0 +42E-0 42.0E2M 42E+9M -42E+9M +42.0E2M ================================================ FILE: test/markup/clojure/symbols-numbers.expect.txt ================================================ (def +x [(a 1) +2 -3.0 y-5]) (System/getProperty "java.vm.version") (.getEnclosingClass java.util.Map$Entry) (java.util.Map$Entry. .getEnclosingClass) ================================================ FILE: test/markup/clojure/symbols-numbers.txt ================================================ (def +x [(a 1) +2 -3.0 y-5]) (System/getProperty "java.vm.version") (.getEnclosingClass java.util.Map$Entry) (java.util.Map$Entry. .getEnclosingClass) ================================================ FILE: test/markup/clojure-repl/prompt.expect.txt ================================================ user=> => ================================================ FILE: test/markup/clojure-repl/prompt.txt ================================================ user=> => ================================================ FILE: test/markup/cmake/default.expect.txt ================================================ cmake_minimum_required(VERSION 2.8.8) project(cmake_example) # Show message on Linux platform if (${CMAKE_SYSTEM_NAME} MATCHES Linux) message("Good choice, bro!") endif() # Tell CMake to run moc when necessary: set(CMAKE_AUTOMOC ON) # As moc files are generated in the binary dir, # tell CMake to always look for includes there: set(CMAKE_INCLUDE_CURRENT_DIR ON) # Widgets finds its own dependencies. 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") ================================================ FILE: test/markup/cmake/default.txt ================================================ cmake_minimum_required(VERSION 2.8.8) project(cmake_example) # Show message on Linux platform if (${CMAKE_SYSTEM_NAME} MATCHES Linux) message("Good choice, bro!") endif() # Tell CMake to run moc when necessary: set(CMAKE_AUTOMOC ON) # As moc files are generated in the binary dir, # tell CMake to always look for includes there: set(CMAKE_INCLUDE_CURRENT_DIR ON) # Widgets finds its own dependencies. 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") ================================================ FILE: test/markup/coffeescript/division.expect.txt ================================================ # Divisions x = 6/foo/i x = 6 /foo x = 6 / foo x = 6 /foo * 2/gm x = f /foo x = f / foo / gm x = f /foo * 2/6 ================================================ FILE: test/markup/coffeescript/division.txt ================================================ # Divisions x = 6/foo/i x = 6 /foo x = 6 / foo x = 6 /foo * 2/gm x = f /foo x = f / foo / gm x = f /foo * 2/6 ================================================ FILE: test/markup/coffeescript/freeze_bug.expect.txt ================================================ TEST@TEST(1):online> TEST TEST version=3 meow=BLAH+BLAH\/BLAH+BLAH= data=BLAH+BLAH\/BLAH\/BLAH+BLAH\/BLAH\/BLAH+BLAH\/BLAH+BLAH+BLAH+BLAH+BLAH\/BLAH+BLAH+BLAH+BLAH+BLAH+BLAH+BLAH+BLAH\/BLAH\/BLAH\/BLAH+BLAH+BLAH\/BLAH\/QfwwjxZ+i3\/I0\/Ku4TtlywzkUCgjcKM8WDHbOlj0dMu8xQTEoucssL+cNi5migI6wdlvEzKlGsBcwT3QXAz4qdZ5n\/aJOxBSJ5XnIGfgeZr\/AJKEm7q\/wfU5hWp3bkXNaba1PMln76N2BWP9vb2OJYNT2wMsxhm\/RAr22gj\/crvDlg95T+MxcIsjz0mt2wXUr\/coqiNWmJ2jpmLwhF0HuLk9oHsc0tLh0JuaqGETFegnBAXdV3nrlOVZTSf3dz7Eotshzn8JbOXSKk12CITzFONf3BxDPyvBiEPIjFaIHGXsPKMGR6XqF4A3SGsbpzVsLRGy5Lb2OkumuBQMNArAZPhPkkAGBH9ZOkmBPJpFcBo4tRhuwgY9saa0VqInvjXE1Hyhffx8U5xwu28hztiebpuA3EyeJV+CPfpfEP3I1sQrtblSo9\/cZybBcVpaTO+Gbflksf1MW5RindyQwAJcygINFnAXwcOPfh8Y8ea8JzlVGrg2a6fPRTwESdM7E4mC56JaftlY8G5ia3v15RiZKNuQWXifbajeUh3NNCFcudprSnIIF2Edg\/PAM\/qUINyVmT4w5I9dbZQTKljpWEcmkNHzhtsDWArYHeigIUp7sU1gcyHfQgPzsJUW\/hsPTAOuYLo27g1EnobxqgGyVAKLn2LpTWsr9gA7Q0ecw8BNkX39DynSCOOWAWUMwdXd3aI9Gim23f2LcgKhamTDu4F8o8JJQtkpAW6cloK2vxjUUfMchHUO9ggWM6vB4MofHYeM0+2HLN3ybCcD9blRxA\/GgggRnvX63IXASxF642CSPW7WsOUKhXmTO5LXkUwSS+yxyhHeKoidJiJ0S8qSORmW\/o1EZDiBg64cZES+dRB2iQrPEnCkELgWq9WADgygw+iVXSoMdehwDGWQmsZqI6EpWuQp7sqQczpSKNOqgmZ0I7ZRDi032XHgXv8FzUh4qLu9KQa8pAd84Egg0sOZxPhyZCpAz2joNl5SMi8NfcH73Fv5dkuDYwR1wy4YixHW2Tzdikx+AUqtI1GfR21vLjzxeq+XSUVlCcR068XTDkZSiFpgDiwiyoXNLGeIUK3P5\/1aiAUxM\/wYBvbHAOsDapWM1pQnw8ieElyiUfEPPFn9z1zwnEwQ0FAygFmRAYvVe2LPM9RA0SYtyiV8+CGAUxYJFGEthpjMTHoE3ni6Zt3kfqoUNibvzVKHScNJjRGPM1jizE0\/nI2bqbsufL9gP1VlCcMf6u0akKKala2+YvO0KUYZyo44VvohfJH9jxRTzg7nrrGdyp0vmcCKyAqVP4sv\/\/6DwMERIpKjkDjNJ\/WegPi9tUo7lHPxXUbitqD03TfLekjvtKBxWQ0Inc6ftbHHmrDpL45oDjk9Wl8NMwLCmNZTnKoEGin8WiS4PnJ3ukRuLQ7jJ6gXn+tGMI6GWSZPQreIJxLSXvi1Yr+SO\/lUN8eUBx9\/PIf45xHeZ8\/ENUpIbCJaRI4mKLQJ\/hsKwPdjG5KpnhkCfMnRMQ\/jIOEPQXVQQ8BCpiphLkgUP6T4hXtScADnqRM23VG8YM3gphAhwOpDaqIE7Ait1Hrg2EJSnQtHA2W93n6yD\/Ovz3+xDgVyc\/uuZaMNpgWsAZOq2yhur1yyg7c7Fra1XBEhVIAJp4tWnOWt5Or7h96C52iN5MnmoMHxWZttrtyHGCUjAg0qhVrOyBkNZn5x\/6nPTiqKGsBNspNxHh5ULeXr00gLwHi3kEa9hUQmPDN1IBcGz6XcBSRrWcK5puw7ugsqEPsKmlNfQczRt88R8366QuuukO7CEGOQt4gWLDhHvJJmVDPKmQNJa5yRCc7wU0XmbK6CDUJo+zdWP0AeF\/M+EbD+S4Zn4gSu359jVdQ2kGxi7U1s26q9kMsPiRS4HB0w3lKtu4nh7PDtpqoTaaeMBFXjAR+eMMCTTpTZ3W6iPsz7n3e\/edbDf8HgVGX0\/lkJGz1pf+zylw4fh9R6B3bCbeNNf+ILO757GPePTsO+SjL2uKWa09pxv\/VUwWq5X\/YT8LnaMqvXrGQrRVYC+8r3SGEPH31FC3cI5LT5QJxD+3IW0XNZBumaKAdOSw\/7HH3gmuXrkZLNKtYhhlM1hlzB4BU7FNTjfFOFkhlJWHJSvegzzXRxCAcwzdrpSLcPwfJDPrRwV520HBzZwyTuDDG01RS9tTsp5yGTtUuzlcZCZJeM8TRY5ag9Fc4oYL2Cxjr0S2knIPCJ3GJD2wvgv4zkJKvVQwUiQGgXTQ9fT6v3Eg3941dl64hnVF0aN2mqUuP1QTnykHKHVQgDkrpq8fSoppp9wXZ9IpVglQAIqY+a6doHrTxJQuaLAmiZGYnpQHHSDVQXglLvixwqbunUHIa0sVeljCf4OQJQX4gwPvvjfiG+wqB8qBy05vr\/zm4diki+kkHk\/9tLwjI81HbYLrKQMMYGPuvWUo1iWxl5\/2Thswjz5Z2EvaGWIF6db5T5\/oWdnEP2PAAHLQG3jQCScgeYJ1sz1z\/Oi26DpShz10HB88Y57\/tRpE8pJ7\/BCpJn2x1X8ISgqzvxLgVpzAuIa0HYL\/uGkCCk1vK2dS8Bud3F2HlvpsNRdRt1Kxzgnj5nMBPW1KN1drMTSl4Ob0FKLqUXJQRHiT+24ETUJjNQV4Ez+BjEWVgwpyHQ5+kyrrtyhS282ArzL1ppCuxj+5caSY6jdHbwEEKzCYvJj9t45hApImUrGFoA58o2\/LBNVsZl5IJiJ6izCsFuf5aZ\/Slw42Xa01RwchGYQUarj7JBEFTpFlRTzGX+uSeMfn4OmHKhPVAyfu26BdBCIhDHw1xGx5pkCfJIMjKKhOvOQyZndZpDy0B5JFngcIYcuQm+3iBW8fjHyzuo1qrBCd6kZJ0+1afwMQkkdztX2jauJnIYtrQIxKzrlBSoc464DIxe4G8aMSJLB4gWAjqC8yBQ38\/RYnIVIGC8SvqKrTYiZF78iWli3VxP5bTGCXZLMogdadfb41RC426viAIPRZ1W\/LNLTX1JjTX0gqyXDsUl7pLu3hA02Toddq\/lnLC\/yPC0ghyaGYTJTnZS+RO49LY30p0tN1y5UJ\/4ORgA59gLtliSAqbZRvNLwbyLcdDDVL0e13NXkm4Qkd5Yd\/e+Xto9VDdIbhWh7XTMyTHecHkDm7aChHxdsAuT5Sx+o6pUZc+oPWMsm9Aruv6KzNvYjW33H2jWY3iOe9fbX5zCWEPupYhVhsq8ipFxA35DsT6Cc6IsEr\/nZS2aBV0ltZdEKVU0x+vLnTAjqla2Qb4qG7KkoZ8pOnlFMdcooU7AYRhXE+f+2QC7kwXLEJ6A1AOxSm9rpoCtScmLTokSS1CSDIRgwOteeBAe0wG1oNt9Sbzz7giagCt+7sdhbvQQKp9WYFOQAJSSUoC6bWgwnvA1\/ewJu3XkmhKtRa2oop12QQuxC4lkYv9G18mo0JQHmRcLeUFLoDZ+6c6yMOhjPaK63LbHCUBAm05jk\/IMRTIp5am1sAaGHakYqsbQxxMO9tvzAE3gEChcbDWS3cyTQPpEJiJvlEDPexUwueFQMRaL0rsFdEiISR24qGMzr2ej9gKPnCJp6Vp92NJh5UQmka2hJeSK\/qAl56my567sGWsX4gpd0VshqUnjAXPqBwO\/pttFk60Spe6HO6QMnPTOERSVf43ahbrvX0fYc3QyE\/Z27Q16UyekV8oAbvPgkKDrQsg5yjjqMwL64szX7lRUcTgObmloiKP3zPQwQFMS9NFN+VrL49VkMBM5baVRH5L4tlBuAp9yqcWD56T8GRkKOmZOjRxeRCYGpIBL4WbUVsUsIM6NvDI1TneqRUJkNJauf0gudxiDjlwuuz\/S94wxWNHqUT6sJN+6Xw5uyyarMFZuzcRt92Wnrlc4hfIBvww+X+GYE47i3sLDXPlG6uQtYvks2XI+x806hw\/v+0zK40FvkRxNvwMSBr0tB5gtp6lSvYkv\/Q2NTiwRK61nsD6XphaBgDBSwnoNA1AZmHkL69inZ7mLz012wPx+X7eSx1L7d20XErQJqdHPTDywk5TkaOeMN2IyqmdozxFB6JHusVgtV2ghX2Akz5ZcCMwO5urDspFXdVFp9BYr44DcT\/FbjVH0ItbznaUE5cVqgUHkoQYasWltSA5\/HsKwfgyZGRuYMHz3fLr\/YPXfh4fLzxAeEYlhGKIE0MW0sBnZ1oT16XSiDyTOVDF31TmrmSZnZyREIGbIMSL+Ji7JAuuLClBaregWMvYfszTjkDfs82HKOd\/Y2VPC0A6ikrtKMFe1ZMjDXqFPsUthWgpMKdwZnb47FUddoflWbBk7\/U8qrAp5y4UGpGeiYpGFI7dulFwRR\/7nxk5v4dfzXSREhcTtJWS9Vkeg4hhIqodPf33QBP+N4Tbl994lHy8lYLJDmNZxoz4aUs9gdg9dulYskJR7Ml3T\/C98et4O0VQ9Yb7BJaysl+vjC4etfcLpGH1JDUQkq\/S5r25Dg71sOnjgz9IcDbvbJ90icx8OVLFZ1Lglby0wWfz+8MRfqDhCjD\/C5h86Z0Jz4AI6cbv5T6cxh0mTFnsbli22UtTn1z8gBmoyAhyzc1HoiF\/rtwtUJF01zgNVRzU3dFTTR7MFa\/ios6zihg2Xjt0ev1riyiNGOro1Kl3I1+CiLiLBSJhE2gS6wX8f86VLzAw\/XTV+1Z3Qan6Mwdhp+ZVBBkcIVrQU\/U6fNmIWitevGROkHHKY8MhrUG1AqLwsZir7acWb0HbjMSiVpROUUw9754BtB53GH17X739xbKGzyMvh6cJIrWPvvMQKNyL2RVHm5XhwPIBgTSX059NQ9PQD+Ps91NIR0V+Bbs= ================================================ FILE: test/markup/coffeescript/freeze_bug.txt ================================================ TEST@TEST(1):online> TEST TEST version=3 meow=BLAH+BLAH\/BLAH+BLAH= data=BLAH+BLAH\/BLAH\/BLAH+BLAH\/BLAH\/BLAH+BLAH\/BLAH+BLAH+BLAH+BLAH+BLAH\/BLAH+BLAH+BLAH+BLAH+BLAH+BLAH+BLAH+BLAH\/BLAH\/BLAH\/BLAH+BLAH+BLAH\/BLAH\/QfwwjxZ+i3\/I0\/Ku4TtlywzkUCgjcKM8WDHbOlj0dMu8xQTEoucssL+cNi5migI6wdlvEzKlGsBcwT3QXAz4qdZ5n\/aJOxBSJ5XnIGfgeZr\/AJKEm7q\/wfU5hWp3bkXNaba1PMln76N2BWP9vb2OJYNT2wMsxhm\/RAr22gj\/crvDlg95T+MxcIsjz0mt2wXUr\/coqiNWmJ2jpmLwhF0HuLk9oHsc0tLh0JuaqGETFegnBAXdV3nrlOVZTSf3dz7Eotshzn8JbOXSKk12CITzFONf3BxDPyvBiEPIjFaIHGXsPKMGR6XqF4A3SGsbpzVsLRGy5Lb2OkumuBQMNArAZPhPkkAGBH9ZOkmBPJpFcBo4tRhuwgY9saa0VqInvjXE1Hyhffx8U5xwu28hztiebpuA3EyeJV+CPfpfEP3I1sQrtblSo9\/cZybBcVpaTO+Gbflksf1MW5RindyQwAJcygINFnAXwcOPfh8Y8ea8JzlVGrg2a6fPRTwESdM7E4mC56JaftlY8G5ia3v15RiZKNuQWXifbajeUh3NNCFcudprSnIIF2Edg\/PAM\/qUINyVmT4w5I9dbZQTKljpWEcmkNHzhtsDWArYHeigIUp7sU1gcyHfQgPzsJUW\/hsPTAOuYLo27g1EnobxqgGyVAKLn2LpTWsr9gA7Q0ecw8BNkX39DynSCOOWAWUMwdXd3aI9Gim23f2LcgKhamTDu4F8o8JJQtkpAW6cloK2vxjUUfMchHUO9ggWM6vB4MofHYeM0+2HLN3ybCcD9blRxA\/GgggRnvX63IXASxF642CSPW7WsOUKhXmTO5LXkUwSS+yxyhHeKoidJiJ0S8qSORmW\/o1EZDiBg64cZES+dRB2iQrPEnCkELgWq9WADgygw+iVXSoMdehwDGWQmsZqI6EpWuQp7sqQczpSKNOqgmZ0I7ZRDi032XHgXv8FzUh4qLu9KQa8pAd84Egg0sOZxPhyZCpAz2joNl5SMi8NfcH73Fv5dkuDYwR1wy4YixHW2Tzdikx+AUqtI1GfR21vLjzxeq+XSUVlCcR068XTDkZSiFpgDiwiyoXNLGeIUK3P5\/1aiAUxM\/wYBvbHAOsDapWM1pQnw8ieElyiUfEPPFn9z1zwnEwQ0FAygFmRAYvVe2LPM9RA0SYtyiV8+CGAUxYJFGEthpjMTHoE3ni6Zt3kfqoUNibvzVKHScNJjRGPM1jizE0\/nI2bqbsufL9gP1VlCcMf6u0akKKala2+YvO0KUYZyo44VvohfJH9jxRTzg7nrrGdyp0vmcCKyAqVP4sv\/\/6DwMERIpKjkDjNJ\/WegPi9tUo7lHPxXUbitqD03TfLekjvtKBxWQ0Inc6ftbHHmrDpL45oDjk9Wl8NMwLCmNZTnKoEGin8WiS4PnJ3ukRuLQ7jJ6gXn+tGMI6GWSZPQreIJxLSXvi1Yr+SO\/lUN8eUBx9\/PIf45xHeZ8\/ENUpIbCJaRI4mKLQJ\/hsKwPdjG5KpnhkCfMnRMQ\/jIOEPQXVQQ8BCpiphLkgUP6T4hXtScADnqRM23VG8YM3gphAhwOpDaqIE7Ait1Hrg2EJSnQtHA2W93n6yD\/Ovz3+xDgVyc\/uuZaMNpgWsAZOq2yhur1yyg7c7Fra1XBEhVIAJp4tWnOWt5Or7h96C52iN5MnmoMHxWZttrtyHGCUjAg0qhVrOyBkNZn5x\/6nPTiqKGsBNspNxHh5ULeXr00gLwHi3kEa9hUQmPDN1IBcGz6XcBSRrWcK5puw7ugsqEPsKmlNfQczRt88R8366QuuukO7CEGOQt4gWLDhHvJJmVDPKmQNJa5yRCc7wU0XmbK6CDUJo+zdWP0AeF\/M+EbD+S4Zn4gSu359jVdQ2kGxi7U1s26q9kMsPiRS4HB0w3lKtu4nh7PDtpqoTaaeMBFXjAR+eMMCTTpTZ3W6iPsz7n3e\/edbDf8HgVGX0\/lkJGz1pf+zylw4fh9R6B3bCbeNNf+ILO757GPePTsO+SjL2uKWa09pxv\/VUwWq5X\/YT8LnaMqvXrGQrRVYC+8r3SGEPH31FC3cI5LT5QJxD+3IW0XNZBumaKAdOSw\/7HH3gmuXrkZLNKtYhhlM1hlzB4BU7FNTjfFOFkhlJWHJSvegzzXRxCAcwzdrpSLcPwfJDPrRwV520HBzZwyTuDDG01RS9tTsp5yGTtUuzlcZCZJeM8TRY5ag9Fc4oYL2Cxjr0S2knIPCJ3GJD2wvgv4zkJKvVQwUiQGgXTQ9fT6v3Eg3941dl64hnVF0aN2mqUuP1QTnykHKHVQgDkrpq8fSoppp9wXZ9IpVglQAIqY+a6doHrTxJQuaLAmiZGYnpQHHSDVQXglLvixwqbunUHIa0sVeljCf4OQJQX4gwPvvjfiG+wqB8qBy05vr\/zm4diki+kkHk\/9tLwjI81HbYLrKQMMYGPuvWUo1iWxl5\/2Thswjz5Z2EvaGWIF6db5T5\/oWdnEP2PAAHLQG3jQCScgeYJ1sz1z\/Oi26DpShz10HB88Y57\/tRpE8pJ7\/BCpJn2x1X8ISgqzvxLgVpzAuIa0HYL\/uGkCCk1vK2dS8Bud3F2HlvpsNRdRt1Kxzgnj5nMBPW1KN1drMTSl4Ob0FKLqUXJQRHiT+24ETUJjNQV4Ez+BjEWVgwpyHQ5+kyrrtyhS282ArzL1ppCuxj+5caSY6jdHbwEEKzCYvJj9t45hApImUrGFoA58o2\/LBNVsZl5IJiJ6izCsFuf5aZ\/Slw42Xa01RwchGYQUarj7JBEFTpFlRTzGX+uSeMfn4OmHKhPVAyfu26BdBCIhDHw1xGx5pkCfJIMjKKhOvOQyZndZpDy0B5JFngcIYcuQm+3iBW8fjHyzuo1qrBCd6kZJ0+1afwMQkkdztX2jauJnIYtrQIxKzrlBSoc464DIxe4G8aMSJLB4gWAjqC8yBQ38\/RYnIVIGC8SvqKrTYiZF78iWli3VxP5bTGCXZLMogdadfb41RC426viAIPRZ1W\/LNLTX1JjTX0gqyXDsUl7pLu3hA02Toddq\/lnLC\/yPC0ghyaGYTJTnZS+RO49LY30p0tN1y5UJ\/4ORgA59gLtliSAqbZRvNLwbyLcdDDVL0e13NXkm4Qkd5Yd\/e+Xto9VDdIbhWh7XTMyTHecHkDm7aChHxdsAuT5Sx+o6pUZc+oPWMsm9Aruv6KzNvYjW33H2jWY3iOe9fbX5zCWEPupYhVhsq8ipFxA35DsT6Cc6IsEr\/nZS2aBV0ltZdEKVU0x+vLnTAjqla2Qb4qG7KkoZ8pOnlFMdcooU7AYRhXE+f+2QC7kwXLEJ6A1AOxSm9rpoCtScmLTokSS1CSDIRgwOteeBAe0wG1oNt9Sbzz7giagCt+7sdhbvQQKp9WYFOQAJSSUoC6bWgwnvA1\/ewJu3XkmhKtRa2oop12QQuxC4lkYv9G18mo0JQHmRcLeUFLoDZ+6c6yMOhjPaK63LbHCUBAm05jk\/IMRTIp5am1sAaGHakYqsbQxxMO9tvzAE3gEChcbDWS3cyTQPpEJiJvlEDPexUwueFQMRaL0rsFdEiISR24qGMzr2ej9gKPnCJp6Vp92NJh5UQmka2hJeSK\/qAl56my567sGWsX4gpd0VshqUnjAXPqBwO\/pttFk60Spe6HO6QMnPTOERSVf43ahbrvX0fYc3QyE\/Z27Q16UyekV8oAbvPgkKDrQsg5yjjqMwL64szX7lRUcTgObmloiKP3zPQwQFMS9NFN+VrL49VkMBM5baVRH5L4tlBuAp9yqcWD56T8GRkKOmZOjRxeRCYGpIBL4WbUVsUsIM6NvDI1TneqRUJkNJauf0gudxiDjlwuuz\/S94wxWNHqUT6sJN+6Xw5uyyarMFZuzcRt92Wnrlc4hfIBvww+X+GYE47i3sLDXPlG6uQtYvks2XI+x806hw\/v+0zK40FvkRxNvwMSBr0tB5gtp6lSvYkv\/Q2NTiwRK61nsD6XphaBgDBSwnoNA1AZmHkL69inZ7mLz012wPx+X7eSx1L7d20XErQJqdHPTDywk5TkaOeMN2IyqmdozxFB6JHusVgtV2ghX2Akz5ZcCMwO5urDspFXdVFp9BYr44DcT\/FbjVH0ItbznaUE5cVqgUHkoQYasWltSA5\/HsKwfgyZGRuYMHz3fLr\/YPXfh4fLzxAeEYlhGKIE0MW0sBnZ1oT16XSiDyTOVDF31TmrmSZnZyREIGbIMSL+Ji7JAuuLClBaregWMvYfszTjkDfs82HKOd\/Y2VPC0A6ikrtKMFe1ZMjDXqFPsUthWgpMKdwZnb47FUddoflWbBk7\/U8qrAp5y4UGpGeiYpGFI7dulFwRR\/7nxk5v4dfzXSREhcTtJWS9Vkeg4hhIqodPf33QBP+N4Tbl994lHy8lYLJDmNZxoz4aUs9gdg9dulYskJR7Ml3T\/C98et4O0VQ9Yb7BJaysl+vjC4etfcLpGH1JDUQkq\/S5r25Dg71sOnjgz9IcDbvbJ90icx8OVLFZ1Lglby0wWfz+8MRfqDhCjD\/C5h86Z0Jz4AI6cbv5T6cxh0mTFnsbli22UtTn1z8gBmoyAhyzc1HoiF\/rtwtUJF01zgNVRzU3dFTTR7MFa\/ios6zihg2Xjt0ev1riyiNGOro1Kl3I1+CiLiLBSJhE2gS6wX8f86VLzAw\/XTV+1Z3Qan6Mwdhp+ZVBBkcIVrQU\/U6fNmIWitevGROkHHKY8MhrUG1AqLwsZir7acWb0HbjMSiVpROUUw9754BtB53GH17X739xbKGzyMvh6cJIrWPvvMQKNyL2RVHm5XhwPIBgTSX059NQ9PQD+Ps91NIR0V+Bbs= ================================================ FILE: test/markup/coffeescript/function.expect.txt ================================================ returnNull = -> null returnTrue = () -> true square = (x) -> x * x npmWishlist.sha256 = (str) -> throw new Error() str.split(" ").map((m) -> m.charCodeAt(0)) fs.readFile("package.json", "utf-8", (err, content) -> data = JSON.parse(content) data.version ) ================================================ FILE: test/markup/coffeescript/function.txt ================================================ returnNull = -> null returnTrue = () -> true square = (x) -> x * x npmWishlist.sha256 = (str) -> throw new Error() str.split(" ").map((m) -> m.charCodeAt(0)) fs.readFile("package.json", "utf-8", (err, content) -> data = JSON.parse(content) data.version ) ================================================ FILE: test/markup/coffeescript/regex.expect.txt ================================================ # Regexps x = // x = (//) x = (/test/) x = //mig x = //gim x = /something/gim x = /\// x = /\n/ x = /ab\/ ab/ x = f /6 * 2/ - 3 x = f /foo * 2/gm x = if true then /\n/ else /[.,]+/ x = ///^key-#{key}-\d+/// # not a Regexp x = //test x = /boo/test ================================================ FILE: test/markup/coffeescript/regex.txt ================================================ # Regexps x = // x = (//) x = (/test/) x = //mig x = //gim x = /something/gim x = /\// x = /\n/ x = /ab\/ ab/ x = f /6 * 2/ - 3 x = f /foo * 2/gm x = if true then /\n/ else /[.,]+/ x = ///^key-#{key}-\d+/// # not a Regexp x = //test x = /boo/test ================================================ FILE: test/markup/coq/default.expect.txt ================================================ Inductive seq : nat -> Set := | niln : seq 0 | consn : forall n : nat, nat -> seq n -> seq (S n). Fixpoint length (n : nat) (s : seq n) {struct s} : nat := match s with | niln => 0 | consn i _ s' => S (length i s') end. Theorem length_corr : forall (n : nat) (s : seq n), length n s = n. Proof. intros n s. (* reasoning by induction over s. Then, we have two new goals corresponding on the case analysis about s (either it is niln or some consn *) induction s. (* We are in the case where s is void. We can reduce the term: length 0 niln *) simpl. (* We obtain the goal 0 = 0. *) trivial. (* now, we treat the case s = consn n e s with induction hypothesis IHs *) simpl. (* The induction hypothesis has type length n s = n. So we can use it to perform some rewriting in the goal: *) rewrite IHs. (* Now the goal is the trivial equality: S n = S n *) trivial. (* Now all sub cases are closed, we perform the ultimate step: typing the term built using tactics and save it as a witness of the theorem. *) Qed. ================================================ FILE: test/markup/coq/default.txt ================================================ Inductive seq : nat -> Set := | niln : seq 0 | consn : forall n : nat, nat -> seq n -> seq (S n). Fixpoint length (n : nat) (s : seq n) {struct s} : nat := match s with | niln => 0 | consn i _ s' => S (length i s') end. Theorem length_corr : forall (n : nat) (s : seq n), length n s = n. Proof. intros n s. (* reasoning by induction over s. Then, we have two new goals corresponding on the case analysis about s (either it is niln or some consn *) induction s. (* We are in the case where s is void. We can reduce the term: length 0 niln *) simpl. (* We obtain the goal 0 = 0. *) trivial. (* now, we treat the case s = consn n e s with induction hypothesis IHs *) simpl. (* The induction hypothesis has type length n s = n. So we can use it to perform some rewriting in the goal: *) rewrite IHs. (* Now the goal is the trivial equality: S n = S n *) trivial. (* Now all sub cases are closed, we perform the ultimate step: typing the term built using tactics and save it as a witness of the theorem. *) Qed. ================================================ FILE: test/markup/cos/basic.expect.txt ================================================ SET test = 1 set ^global = 2 Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 if (^global = 2) { do ##class(Cinema.Utils).AddShow("test") // line comment } d:(^global = 2) ..thisClassMethod(1, 2, "test") ================================================ FILE: test/markup/cos/basic.txt ================================================ SET test = 1 set ^global = 2 Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3 if (^global = 2) { do ##class(Cinema.Utils).AddShow("test") // line comment } d:(^global = 2) ..thisClassMethod(1, 2, "test") ================================================ FILE: test/markup/cos/embedded.expect.txt ================================================ /* * Multiline comment */ &sql(SELECT * FROM Cinema.Film WHERE Length > 2) &js<for (var i = 0; i < String("test").split("").length); ++i) { console.log(i); }> ================================================ FILE: test/markup/cos/embedded.txt ================================================ /* * Multiline comment */ &sql(SELECT * FROM Cinema.Film WHERE Length > 2) &js ================================================ FILE: test/markup/cpp/bitwise-keywords.expect.txt ================================================ unsigned char a = 0xFA; unsigned char b = 0x4C; a = compl b; a = not b; a and b; a bitor b; a or b; a xor b; a bitand b; a and_eq b; a or_eq b; a xor_eq b; a not_eq b; ================================================ FILE: test/markup/cpp/bitwise-keywords.txt ================================================ unsigned char a = 0xFA; unsigned char b = 0x4C; a = compl b; a = not b; a and b; a bitor b; a or b; a xor b; a bitand b; a and_eq b; a or_eq b; a xor_eq b; a not_eq b; ================================================ FILE: test/markup/cpp/bugs.expect.txt ================================================ //4. 对角矩阵 //4.1 构造对角矩阵 Eigen::VectorXd vector(5); //构建5维向量 vector<<1,2,3,4,5; //向量赋值 Eigen::MatrixXd C(vector.asDiagonal()); //使用向量生成对角阵 std::cout << "\nC= \n" << C << std::endl; ================================================ FILE: test/markup/cpp/bugs.txt ================================================ //4. 对角矩阵 //4.1 构造对角矩阵 Eigen::VectorXd vector(5); //构建5维向量 vector<<1,2,3,4,5; //向量赋值 Eigen::MatrixXd C(vector.asDiagonal()); //使用向量生成对角阵 std::cout << "\nC= \n" << C << std::endl; ================================================ FILE: test/markup/cpp/comments.expect.txt ================================================ // line comment /* block comment */ /* block comment across lines */ #include <sys/wait.h> // line comment #include <sys/wait.h> /* block comment */ /* Truncated block comment ================================================ FILE: test/markup/cpp/comments.txt ================================================ // line comment /* block comment */ /* block comment across lines */ #include // line comment #include /* block comment */ /* Truncated block comment ================================================ FILE: test/markup/cpp/expression-keywords.expect.txt ================================================ double x = exp(log(2)); // recognize built-ins return 0; // recognize keyword that started the expression ================================================ FILE: test/markup/cpp/expression-keywords.txt ================================================ double x = exp(log(2)); // recognize built-ins return 0; // recognize keyword that started the expression ================================================ FILE: test/markup/cpp/function-declarations.expect.txt ================================================ decltype(auto) look_up_a_string_1() { return lookup1(); } void look_up_a_string_2() { return lookup2(); } friend void A::showB(B x) {} friend void showB(B x) {} friend void showB(B::SomeType x) {} inline int add(int a, int b) {} int8t Get_Tile_Value() {} int8_t Get_Tile_Value() {} B::type test() {}; // template boost::optional<application> handle_key(application state, key_code key, coord size); // pack expansion in function arguments template<typename T...> void foo(T... args) {} test(); void A(): a(10) {} explicit A(): a(10) {} extern void f(int), g(char); ================================================ FILE: test/markup/cpp/function-declarations.txt ================================================ decltype(auto) look_up_a_string_1() { return lookup1(); } void look_up_a_string_2() { return lookup2(); } friend void A::showB(B x) {} friend void showB(B x) {} friend void showB(B::SomeType x) {} inline int add(int a, int b) {} int8t Get_Tile_Value() {} int8_t Get_Tile_Value() {} B::type test() {}; // template boost::optional handle_key(application state, key_code key, coord size); // pack expansion in function arguments template void foo(T... args) {} test(); void A(): a(10) {} explicit A(): a(10) {} extern void f(int), g(char); ================================================ FILE: test/markup/cpp/function-like-keywords.expect.txt ================================================ if (ch) {} switch (ch) {} while (ch) {} for (;;) {} void f() = delete("reason"); static_assert(true); ================================================ FILE: test/markup/cpp/function-like-keywords.txt ================================================ if (ch) {} switch (ch) {} while (ch) {} for (;;) {} void f() = delete("reason"); static_assert(true); ================================================ FILE: test/markup/cpp/function-params.expect.txt ================================================ int f( int a = 1, char* b = "2", // Line comment double c = 3.0, /* Block comment */ ARRAY(int, 5) d, void* e __attribute__((unused)) ); ================================================ FILE: test/markup/cpp/function-params.txt ================================================ int f( int a = 1, char* b = "2", // Line comment double c = 3.0, /* Block comment */ ARRAY(int, 5) d, void* e __attribute__((unused)) ); ================================================ FILE: test/markup/cpp/function-title.expect.txt ================================================ int main(int argc, char** argv) { auto a = std::make_unique<A>(); B *b = new B(); int c = c * sum(1, 2); if (a->check1()) return 3; else if (a->check2()) return 4; return a->result(); } ================================================ FILE: test/markup/cpp/function-title.txt ================================================ int main(int argc, char** argv) { auto a = std::make_unique(); B *b = new B(); int c = c * sum(1, 2); if (a->check1()) return 3; else if (a->check2()) return 4; return a->result(); } ================================================ FILE: test/markup/cpp/initializers.expect.txt ================================================ string a("hello"), b("world"); vector<int> u(1), v(2); ================================================ FILE: test/markup/cpp/initializers.txt ================================================ string a("hello"), b("world"); vector u(1), v(2); ================================================ FILE: test/markup/cpp/number-literals.expect.txt ================================================ /* Floating-point literals. */ // Decimal. 1. +12. -1'234. 1.2 1.234'5 1'234.567'8 1'234.567'8e-9 1'234.567'8E9'0 1234e56 1'234e5'6 // Hexadecimal. 0x1p2 +0x1.p2 -0X1A.P2 0x1A'2B3C.p4 0x1.Ap2 0x1A.2B3C'4Dp+5 0x1A'2b3C.4D5e'6Fp7'8 // Literal suffixes. 1.F 1.F16 1.F32 1.f64 1.f128 2.BF16 2.bf16 0X3'4.P5L 0x3'4.p5l /* Integer literals. */ // Binary. +0b1 0B01 -0b10'1011 // Hexadecimal. +0x1 0X1A -0x1A'2b3C // Octal. +01 012 -0123'4567 // Decimal. 0 +1 12 -123'456'789 // Literal suffixes. 0B1U 0b1u 0X2L 0x2l 03LL 03ll 4UL 4Ul 4uL 4ul 5LU 5Lu 5lU 5lu 6ULL 6Ull 6uLL 6ull 7LLU 7LLu 7llU 7llu 8ZU 8Zu 8zU 8zu 9'0UZ 9'0Uz 9'0uZ 9'0uz char word[] = { '3', '\0' }; // Make sure digit separators don't mess up chars. ================================================ FILE: test/markup/cpp/number-literals.txt ================================================ /* Floating-point literals. */ // Decimal. 1. +12. -1'234. 1.2 1.234'5 1'234.567'8 1'234.567'8e-9 1'234.567'8E9'0 1234e56 1'234e5'6 // Hexadecimal. 0x1p2 +0x1.p2 -0X1A.P2 0x1A'2B3C.p4 0x1.Ap2 0x1A.2B3C'4Dp+5 0x1A'2b3C.4D5e'6Fp7'8 // Literal suffixes. 1.F 1.F16 1.F32 1.f64 1.f128 2.BF16 2.bf16 0X3'4.P5L 0x3'4.p5l /* Integer literals. */ // Binary. +0b1 0B01 -0b10'1011 // Hexadecimal. +0x1 0X1A -0x1A'2b3C // Octal. +01 012 -0123'4567 // Decimal. 0 +1 12 -123'456'789 // Literal suffixes. 0B1U 0b1u 0X2L 0x2l 03LL 03ll 4UL 4Ul 4uL 4ul 5LU 5Lu 5lU 5lu 6ULL 6Ull 6uLL 6ull 7LLU 7LLu 7llU 7llu 8ZU 8Zu 8zU 8zu 9'0UZ 9'0Uz 9'0uZ 9'0uz char word[] = { '3', '\0' }; // Make sure digit separators don't mess up chars. ================================================ FILE: test/markup/cpp/pointers-returns.expect.txt ================================================ // These will all work: char** foo_bar(); char ** foo_bar(); char **foo_bar(); ================================================ FILE: test/markup/cpp/pointers-returns.txt ================================================ // These will all work: char** foo_bar(); char ** foo_bar(); char **foo_bar(); ================================================ FILE: test/markup/cpp/preprocessor.expect.txt ================================================ #include <iostream> #define foo 1<<16 #ifdef DEBUG TYPE1 foo(void) #else int foo(void) #endif { } #define x(v) ((v)) # define x(v) ((v)) # define x(v) ((v)) #if MACRO_WITH_STRING_ARG("hello \"world\"") #elif MULTI_LINE /* comment */ < \ EXPRESSION int bar; #endif // comment if (p) { #ifdef DEBUG onething(); #endif } else if (errno) { #ifdef DEBUG anotherthing(); #endif } // this is a continued\ comment. end ================================================ FILE: test/markup/cpp/preprocessor.txt ================================================ #include #define foo 1<<16 #ifdef DEBUG TYPE1 foo(void) #else int foo(void) #endif { } #define x(v) ((v)) # define x(v) ((v)) # define x(v) ((v)) #if MACRO_WITH_STRING_ARG("hello \"world\"") #elif MULTI_LINE /* comment */ < \ EXPRESSION int bar; #endif // comment if (p) { #ifdef DEBUG onething(); #endif } else if (errno) { #ifdef DEBUG anotherthing(); #endif } // this is a continued\ comment. end ================================================ FILE: test/markup/cpp/primitive-types.expect.txt ================================================ // Primitive types: char8_t test; char16_t test; char32_t test; char8_t test; int8_t test; int16_t test; int32_t test; int64_t test; int_fast8_t test; int_fast16_t test; int_fast32_t test; int_fast64_t test; int_least8_t test; int_least16_t test; int_least32_t test; int_least64_t test; intmax_t test; intptr_t test; uint8_t test; uint16_t test; uint32_t test; uint64_t test; uint_fast8_t test; uint_fast16_t test; uint_fast32_t test; uint_fast64_t test; uint_least8_t test; uint_least16_t test; uint_least32_t test; uint_least64_t test; uintmax_t test; uintptr_t test; max_align_t test; mbstate_t test; nullptr_t test; ptrdiff_t test; size_t test; wchar_t test; wctrans_t test; wctype_t test; wint_t test; // Non-primitive type with '_t': struct position_tag; class _thread; // Type traits and helpers types: template<class T> using decay_t = typename decay<T>::type; template<typename T> struct X { using decayed_t = typename std::decay_t<X<T>>; }; X<int&>::decayed_t x; ================================================ FILE: test/markup/cpp/primitive-types.txt ================================================ // Primitive types: char8_t test; char16_t test; char32_t test; char8_t test; int8_t test; int16_t test; int32_t test; int64_t test; int_fast8_t test; int_fast16_t test; int_fast32_t test; int_fast64_t test; int_least8_t test; int_least16_t test; int_least32_t test; int_least64_t test; intmax_t test; intptr_t test; uint8_t test; uint16_t test; uint32_t test; uint64_t test; uint_fast8_t test; uint_fast16_t test; uint_fast32_t test; uint_fast64_t test; uint_least8_t test; uint_least16_t test; uint_least32_t test; uint_least64_t test; uintmax_t test; uintptr_t test; max_align_t test; mbstate_t test; nullptr_t test; ptrdiff_t test; size_t test; wchar_t test; wctrans_t test; wctype_t test; wint_t test; // Non-primitive type with '_t': struct position_tag; class _thread; // Type traits and helpers types: template using decay_t = typename decay::type; template struct X { using decayed_t = typename std::decay_t>; }; X::decayed_t x; ================================================ FILE: test/markup/cpp/string-literals.expect.txt ================================================ // Unicode literals auto str = "Hello regular string"; auto utf8 = u8"Hello utf-8 string"; auto utf16 = u"Hello utf-16 string"; auto utf32 = U"Hello utf-32 string"; // Wide-character strings auto wide_char = L"Hello wchar_t string"; auto lr = LR"(Hello world)"; // character literals auto wide_char = L'H'; auto cr = '\n'; auto chr = 'H'; auto utf8 = u8'H'; auto utf16 = u'H'; auto utf32 = U'H'; auto unicode = L'\u202e' auto hex = '\xFF' auto octal = '\123' // Raw string literals (multiline) auto char_multi = R"(Hello "normal" multiline string.)"; auto utf8_multi = u8R"(Hello "utf-8" multiline string)"; auto utf16_multi = uR"(Hello "utf-16" multiline string)"; auto utf32_multi = UR"(Hello "utf-32" multiline string)"; // Raw string literals with delimiter (multiline) auto char_multi = R"blah1(Hello "normal" multiline )" )blah" string.)blah1"; auto utf8_multi = u8R"blah2(Hello "utf-8" multiline )" )blah" string)blah2"; auto utf16_multi = uR"blah3(Hello "utf-16" multiline )" )blah" string)blah3"; auto utf32_multi = UR"blah4(Hello "utf-32" multiline )" )blah" string)blah4"; // Meta strings #include <stdio> #include "lib.h" ================================================ FILE: test/markup/cpp/string-literals.txt ================================================ // Unicode literals auto str = "Hello regular string"; auto utf8 = u8"Hello utf-8 string"; auto utf16 = u"Hello utf-16 string"; auto utf32 = U"Hello utf-32 string"; // Wide-character strings auto wide_char = L"Hello wchar_t string"; auto lr = LR"(Hello world)"; // character literals auto wide_char = L'H'; auto cr = '\n'; auto chr = 'H'; auto utf8 = u8'H'; auto utf16 = u'H'; auto utf32 = U'H'; auto unicode = L'\u202e' auto hex = '\xFF' auto octal = '\123' // Raw string literals (multiline) auto char_multi = R"(Hello "normal" multiline string.)"; auto utf8_multi = u8R"(Hello "utf-8" multiline string)"; auto utf16_multi = uR"(Hello "utf-16" multiline string)"; auto utf32_multi = UR"(Hello "utf-32" multiline string)"; // Raw string literals with delimiter (multiline) auto char_multi = R"blah1(Hello "normal" multiline )" )blah" string.)blah1"; auto utf8_multi = u8R"blah2(Hello "utf-8" multiline )" )blah" string)blah2"; auto utf16_multi = uR"blah3(Hello "utf-16" multiline )" )blah" string)blah3"; auto utf32_multi = UR"blah4(Hello "utf-32" multiline )" )blah" string)blah4"; // Meta strings #include #include "lib.h" ================================================ FILE: test/markup/cpp/template-complexity.expect.txt ================================================ template <class T> // comment auto foo(T x) { ... }; namespace impl { template<typename T> struct is_streamable<T, std::void_t<decltype(std::declval<std::wostream &>() << std::declval<T>())>> : std::true_type { }; } // Disable overload for already valid operands. template<class T, class = std::enable_if_t<!impl::is_streamable_v<const T &> && std::is_convertible_v<const T &, std::wstring_view>>> std::wostream &operator <<(std::wostream &stream, const T &thing) { return stream << static_cast<std::wstring_view>(thing); } enum struct DataHolder { }; enum class DataThingy { }; enum class Boolean : char { True, False, FileNotFound }; union Soy { }; ================================================ FILE: test/markup/cpp/template-complexity.txt ================================================ template // comment auto foo(T x) { ... }; namespace impl { template struct is_streamable() << std::declval())>> : std::true_type { }; } // Disable overload for already valid operands. template && std::is_convertible_v>> std::wostream &operator <<(std::wostream &stream, const T &thing) { return stream << static_cast(thing); } enum struct DataHolder { }; enum class DataThingy { }; enum class Boolean : char { True, False, FileNotFound }; union Soy { }; ================================================ FILE: test/markup/cpp/truncated-raw-string.expect.txt ================================================ R"foo( Truncated raw string )nope" Still not completed. ================================================ FILE: test/markup/cpp/truncated-raw-string.txt ================================================ R"foo( Truncated raw string )nope" Still not completed. ================================================ FILE: test/markup/crmsh/default.expect.txt ================================================ node webui node 168633611: node1 rsc_template web-server apache \ params port=8000 \ op monitor interval=10s # Never use this STONITH agent in production! primitive development-stonith stonith:null \ params hostlist="webui node1 node2 node3" primitive proxy systemd:haproxy \ op monitor interval=10s primitive proxy-vip IPaddr2 \ params ip=10.13.37.20 primitive srv1 @web-server primitive srv2 @web-server primitive test1 Dummy primitive test2 IPaddr2 \ params ip=10.13.37.99 primitive vip1 IPaddr2 \ params ip=10.13.37.21 \ op monitor interval=20s primitive vip2 IPaddr2 \ params ip=10.13.37.22 \ op monitor interval=20s group g-proxy proxy-vip proxy group g-serv1 vip1 srv1 group g-serv2 vip2 srv2 # Never put the two web servers on the same node colocation co-serv -inf: g-serv1 g-serv2 # Never put any web server or haproxy on webui location l-avoid-webui { g-proxy g-serv1 g-serv2 } -inf: webui # Prever to spread groups across nodes location l-proxy g-proxy 200: node1 location l-serv1 g-serv1 200: node2 location l-serv2 g-serv2 200: node3 property cib-bootstrap-options: \ stonith-enabled=true \ no-quorum-policy=ignore \ placement-strategy=balanced \ have-watchdog=false \ dc-version="1.1.13-1.1.13+git20150827.e8888b9" \ cluster-infrastructure=corosync \ cluster-name=hacluster rsc_defaults rsc-options: \ resource-stickiness=1 \ migration-threshold=3 op_defaults op-options: \ timeout=600 \ record-pending=true ================================================ FILE: test/markup/crmsh/default.txt ================================================ node webui node 168633611: node1 rsc_template web-server apache \ params port=8000 \ op monitor interval=10s # Never use this STONITH agent in production! primitive development-stonith stonith:null \ params hostlist="webui node1 node2 node3" primitive proxy systemd:haproxy \ op monitor interval=10s primitive proxy-vip IPaddr2 \ params ip=10.13.37.20 primitive srv1 @web-server primitive srv2 @web-server primitive test1 Dummy primitive test2 IPaddr2 \ params ip=10.13.37.99 primitive vip1 IPaddr2 \ params ip=10.13.37.21 \ op monitor interval=20s primitive vip2 IPaddr2 \ params ip=10.13.37.22 \ op monitor interval=20s group g-proxy proxy-vip proxy group g-serv1 vip1 srv1 group g-serv2 vip2 srv2 # Never put the two web servers on the same node colocation co-serv -inf: g-serv1 g-serv2 # Never put any web server or haproxy on webui location l-avoid-webui { g-proxy g-serv1 g-serv2 } -inf: webui # Prever to spread groups across nodes location l-proxy g-proxy 200: node1 location l-serv1 g-serv1 200: node2 location l-serv2 g-serv2 200: node3 property cib-bootstrap-options: \ stonith-enabled=true \ no-quorum-policy=ignore \ placement-strategy=balanced \ have-watchdog=false \ dc-version="1.1.13-1.1.13+git20150827.e8888b9" \ cluster-infrastructure=corosync \ cluster-name=hacluster rsc_defaults rsc-options: \ resource-stickiness=1 \ migration-threshold=3 op_defaults op-options: \ timeout=600 \ record-pending=true ================================================ FILE: test/markup/crystal/defs.expect.txt ================================================ def foo end def *(other) end def **(other) end def =~(other) end def !~(other) end ================================================ FILE: test/markup/crystal/defs.txt ================================================ def foo end def *(other) end def **(other) end def =~(other) end def !~(other) end ================================================ FILE: test/markup/crystal/literals.expect.txt ================================================ nil true false 1 1_i8 1_i16 1_i32 1_i64 1_i128 1_u8 1_u16 1_u32 1_u64 +10 -20 2147483648 9223372036854775808 1_000_000 0b1101 0o123 0xFE012D 0xfe012d 1_f64 1.0 1.0_f32 1_f32 1e10 1e10_f64 1.5e10 1.5e-7 +1.3 -0.5 1_000_000.111_111 1_000_000.111_111e12 'c' '\\' '\u{ABCD}' "string" "\u{48 45 4C 4C 4F}" "interpolated #{string}" "interpolated #{"string"}" %(string) %q(string) %Q(string) %(hello ("world")) %[hello ["world"]] %{hello {"world"}} %<hello <"world">> %|hello "world"| "hello world" "hello \ world, \ no newlines" <<-STRING Hello world STRING <<-'HERE' hello \n HERE :unquoted_symbol :"quoted symbol" :question? :exclamation! :+ %i(foo(bar) baz) %w(one two three) /foo|bar/ /h(e+)llo/ /\d+/ /あ/ %r((/)) %r[[/]] %r{{/}} %r<</>> %r|/| `echo foo > foo.txt` ================================================ FILE: test/markup/crystal/literals.txt ================================================ nil true false 1 1_i8 1_i16 1_i32 1_i64 1_i128 1_u8 1_u16 1_u32 1_u64 +10 -20 2147483648 9223372036854775808 1_000_000 0b1101 0o123 0xFE012D 0xfe012d 1_f64 1.0 1.0_f32 1_f32 1e10 1e10_f64 1.5e10 1.5e-7 +1.3 -0.5 1_000_000.111_111 1_000_000.111_111e12 'c' '\\' '\u{ABCD}' "string" "\u{48 45 4C 4C 4F}" "interpolated #{string}" "interpolated #{"string"}" %(string) %q(string) %Q(string) %(hello ("world")) %[hello ["world"]] %{hello {"world"}} %> %|hello "world"| "hello world" "hello \ world, \ no newlines" <<-STRING Hello world STRING <<-'HERE' hello \n HERE :unquoted_symbol :"quoted symbol" :question? :exclamation! :+ %i(foo(bar) baz) %w(one two three) /foo|bar/ /h(e+)llo/ /\d+/ /あ/ %r((/)) %r[[/]] %r{{/}} %r<> %r|/| `echo foo > foo.txt` ================================================ FILE: test/markup/crystal/macro.expect.txt ================================================ puts {{ "hello world" }} {% verbatim %}{{ "bla".id }}{% end %} macro foo {% verbatim %} {{ "bla".id }} {% end %} end ================================================ FILE: test/markup/crystal/macro.txt ================================================ puts {{ "hello world" }} {% verbatim %}{{ "bla".id }}{% end %} macro foo {% verbatim %} {{ "bla".id }} {% end %} end ================================================ FILE: test/markup/crystal/operators.expect.txt ================================================ + - * % & | ^ ** << >> == != < <= > >= <=> === // //= &+ &- &* &** &+= &-= &*= ! ~ [] []? []= / ================================================ FILE: test/markup/crystal/operators.txt ================================================ + - * % & | ^ ** << >> == != < <= > >= <=> === // //= &+ &- &* &** &+= &-= &*= ! ~ [] []? []= / ================================================ FILE: test/markup/crystal/regexes.expect.txt ================================================ if /foo/ unless /foo/ case /foo/ select /foo/ when /foo/ while /foo/ until /foo/ +/foo/ # NG xif /foo/ ifx /foo/ ================================================ FILE: test/markup/crystal/regexes.txt ================================================ if /foo/ unless /foo/ case /foo/ select /foo/ when /foo/ while /foo/ until /foo/ +/foo/ # NG xif /foo/ ifx /foo/ ================================================ FILE: test/markup/crystal/toplevel-keywords.expect.txt ================================================ class Foo; end struct Bar; end annotation JSON::Field; end ================================================ FILE: test/markup/crystal/toplevel-keywords.txt ================================================ class Foo; end struct Bar; end annotation JSON::Field; end ================================================ FILE: test/markup/csharp/dotted-namespace.expect.txt ================================================ namespace Dotted.Namespace { class MyClass { } } ================================================ FILE: test/markup/csharp/dotted-namespace.txt ================================================ namespace Dotted.Namespace { class MyClass { } } ================================================ FILE: test/markup/csharp/floats.expect.txt ================================================ float test = 1.0f; float test2 = 1.f; float test3 = 1.0; float test4 = 1; float test5 = 1_000; ================================================ FILE: test/markup/csharp/floats.txt ================================================ float test = 1.0f; float test2 = 1.f; float test3 = 1.0; float test4 = 1; float test5 = 1_000; ================================================ FILE: test/markup/csharp/functions.expect.txt ================================================ public void ExampleFunction1() { } public void ExampleFunction2() { } void ExampleFunctionDeclaration1(); void ExampleFunctionDeclaration2() ; public string ExampleExpressionBodiedFunction1() => "dummy"; public string ExampleExpressionBodiedFunction2() => "dummy"; ================================================ FILE: test/markup/csharp/functions.txt ================================================ public void ExampleFunction1() { } public void ExampleFunction2() { } void ExampleFunctionDeclaration1(); void ExampleFunctionDeclaration2() ; public string ExampleExpressionBodiedFunction1() => "dummy"; public string ExampleExpressionBodiedFunction2() => "dummy"; ================================================ FILE: test/markup/csharp/generic_modifiers.expect.txt ================================================ interface IObserver<in T>; {} interface IObservable<out T>; {} public delegate void DContravariant<in A>(A argument); public delegate A DCovariant<out A>(); void MethodWithGenericParameter<T>(); private static List<string> leftHalfDiamond = new List<string>(); private static List<Tuple<int, string>> leftHalfDiamond = new List<Tuple<int, string>>(); ================================================ FILE: test/markup/csharp/generic_modifiers.txt ================================================ interface IObserver; {} interface IObservable; {} public delegate void DContravariant(A argument); public delegate A DCovariant(); void MethodWithGenericParameter(); private static List leftHalfDiamond = new List(); private static List> leftHalfDiamond = new List>(); ================================================ FILE: test/markup/csharp/identifiers.expect.txt ================================================ var @class = new MyClass(); doSomething(@var, @foo); var a; ================================================ FILE: test/markup/csharp/identifiers.txt ================================================ var @class = new MyClass(); doSomething(@var, @foo); var a; ================================================ FILE: test/markup/csharp/records.expect.txt ================================================ public record MyRecord { public string SomeMember { get; init; } } public record Person(string FirstName, string? MiddleName, string LastName); ================================================ FILE: test/markup/csharp/records.txt ================================================ public record MyRecord { public string SomeMember { get; init; } } public record Person(string FirstName, string? MiddleName, string LastName); ================================================ FILE: test/markup/csharp/scoped.expect.txt ================================================ public static ref T AsRef<T>(scoped in T source); ================================================ FILE: test/markup/csharp/scoped.txt ================================================ public static ref T AsRef(scoped in T source); ================================================ FILE: test/markup/csharp/string-interpolation.expect.txt ================================================ var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; var ivstr = $@"{{Hello}}, { $"\"{nested}\"" + @" and " + $@" ""{nested}"" " /*comments*/ }"; ================================================ FILE: test/markup/csharp/string-interpolation.txt ================================================ var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }"; var ivstr = $@"{{Hello}}, { $"\"{nested}\"" + @" and " + $@" ""{nested}"" " /*comments*/ }"; ================================================ FILE: test/markup/csharp/string-raw.expect.txt ================================================ // String raw literals since C# 11. <https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/raw-string> string longMessage1 = """" This is a long message. It has several lines. Some are indented more than others. Some have """quoted text""" in them. \" """"; string longMessage2 = """ This is a long message. It has several lines. Some are indented more than others. Some have ""quoted text"" in them. \" """; ================================================ FILE: test/markup/csharp/string-raw.txt ================================================ // String raw literals since C# 11. string longMessage1 = """" This is a long message. It has several lines. Some are indented more than others. Some have """quoted text""" in them. \" """"; string longMessage2 = """ This is a long message. It has several lines. Some are indented more than others. Some have ""quoted text"" in them. \" """; ================================================ FILE: test/markup/csharp/titles.expect.txt ================================================ namespace Foo // namespace { public class Greet : Base, Other, IInterface.test.path // class { public Greet(string who) // function { Who = who; } int[] f(int val = 0) { new Type(); return getType(); throw getError(); await Stuff(); } } public class TesterA<R, S> where R : class where S : IComparable {} } ================================================ FILE: test/markup/csharp/titles.txt ================================================ namespace Foo // namespace { public class Greet : Base, Other, IInterface.test.path // class { public Greet(string who) // function { Who = who; } int[] f(int val = 0) { new Type(); return getType(); throw getError(); await Stuff(); } } public class TesterA where R : class where S : IComparable {} } ================================================ FILE: test/markup/csharp/try-catch.expect.txt ================================================ try { throw new InvalidCastException(); } catch (InvalidCastException e) when (e.Data != null) { throw; } ================================================ FILE: test/markup/csharp/try-catch.txt ================================================ try { throw new InvalidCastException(); } catch (InvalidCastException e) when (e.Data != null) { throw; } ================================================ FILE: test/markup/csp/default.expect.txt ================================================ Content-Security-Policy: default-src 'self'; style-src 'self' css.example.com; style-src-attr 'none'; style-src-elem https://example.com/; img-src *.example.com; fenced-frame-src https://example.com/; report-to name-of-endpoint; require-trusted-types-for 'script'; script-src 'self'; script-src-attr 'none'; script-src-elem https://example.com/; script-src 'unsafe-eval' 'self' js.example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3' ================================================ FILE: test/markup/csp/default.txt ================================================ Content-Security-Policy: default-src 'self'; style-src 'self' css.example.com; style-src-attr 'none'; style-src-elem https://example.com/; img-src *.example.com; fenced-frame-src https://example.com/; report-to name-of-endpoint; require-trusted-types-for 'script'; script-src 'self'; script-src-attr 'none'; script-src-elem https://example.com/; script-src 'unsafe-eval' 'self' js.example.com 'nonce-Nc3n83cnSAd3wc3Sasdfn939hc3' ================================================ FILE: test/markup/css/css_consistency.expect.txt ================================================ /* this test is shared with css, less, scss, and stylus to confirm consistent highlighting */ div { -webkit-animation-name: example; -moz-animation-name: example; -ms-animation-name: example; -o-animation-name: example; animation-name: example; } @-webkit-keyframes example {} @-moz-keyframes example {} @-ms-keyframes example {} @-o-keyframes example {} @keyframes example {} div, p, table { width: 30px; } div { width:0 !important; } h1, h2, figcaption, aside, main, form, footer {} a:visited { color: blue; } div::after { content: "test"; } div:after { content: "test"; } div::before { content: open-quote; } div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} :lang(en) {} a[href*="example"] {} [class^="top"] {} @media (not(hover)) {} @media not all and (max-width: 600px) {} @media only screen and (min-width: 900px) and (color-gamut: p3) {} @media only screen and (min-width: 100px), not all and (min-width: 100px), not print and (min-height: 100px), (color), (min-height: 100px) and (max-height: 1000px), handheld and (orientation: landscape) {} @font-face { font-family: "Open Sans"; font-display: swap; font-stretch: 50% 200%; font-style: oblique 20deg 50deg; font-weight: 100 400; font-variant: no-common-ligatures proportional-nums; font-feature-settings: "liga" 0; font-variation-settings: "xhgt" 0.7; unicode-range: U+0025-00FF, U+4??; /* it's not 100% clear how url and format should be highlighted universally */ /* src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } @keyframes important1 { from { margin-top: 50px; } 50% { margin-top: 60px !important; } to { margin-top: 100px; } } main { --color: red; color: var(--color); } main { /* normal comment */ width: /* inline comment */ 50px; } ================================================ FILE: test/markup/css/css_consistency.txt ================================================ /* this test is shared with css, less, scss, and stylus to confirm consistent highlighting */ div { -webkit-animation-name: example; -moz-animation-name: example; -ms-animation-name: example; -o-animation-name: example; animation-name: example; } @-webkit-keyframes example {} @-moz-keyframes example {} @-ms-keyframes example {} @-o-keyframes example {} @keyframes example {} div, p, table { width: 30px; } div { width:0 !important; } h1, h2, figcaption, aside, main, form, footer {} a:visited { color: blue; } div::after { content: "test"; } div:after { content: "test"; } div::before { content: open-quote; } div:before { content: open-quote; } span:nth-child(33) { color:red; } p:lang(en) {} :lang(en) {} a[href*="example"] {} [class^="top"] {} @media (not(hover)) {} @media not all and (max-width: 600px) {} @media only screen and (min-width: 900px) and (color-gamut: p3) {} @media only screen and (min-width: 100px), not all and (min-width: 100px), not print and (min-height: 100px), (color), (min-height: 100px) and (max-height: 1000px), handheld and (orientation: landscape) {} @font-face { font-family: "Open Sans"; font-display: swap; font-stretch: 50% 200%; font-style: oblique 20deg 50deg; font-weight: 100 400; font-variant: no-common-ligatures proportional-nums; font-feature-settings: "liga" 0; font-variation-settings: "xhgt" 0.7; unicode-range: U+0025-00FF, U+4??; /* it's not 100% clear how url and format should be highlighted universally */ /* src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); */ } @keyframes important1 { from { margin-top: 50px; } 50% { margin-top: 60px !important; } to { margin-top: 100px; } } main { --color: red; color: var(--color); } main { /* normal comment */ width: /* inline comment */ 50px; } ================================================ FILE: test/markup/css/hex-colors.expect.txt ================================================ .test-short { color: #abc; } .test-short-alpha { color: #abcd; } .test-long { color: #aabbcc; } .test-long-alpha { color: #aabbccdd; } .test-invalid { color: #aabbccd; } ================================================ FILE: test/markup/css/hex-colors.txt ================================================ .test-short { color: #abc; } .test-short-alpha { color: #abcd; } .test-long { color: #aabbcc; } .test-long-alpha { color: #aabbccdd; } .test-invalid { color: #aabbccd; } ================================================ FILE: test/markup/css/pseudo-selector.expect.txt ================================================ li:not(.red){} li:not(.red):not(.green){} :first-child { padding: 0; } :first-of-type { padding: 0; } :last-child { padding: 0; } :last-of-type { padding: 0; } p::first-letter { font-size: 1.5rem; font-weight: bold; color: brown; } ================================================ FILE: test/markup/css/pseudo-selector.txt ================================================ li:not(.red){} li:not(.red):not(.green){} :first-child { padding: 0; } :first-of-type { padding: 0; } :last-child { padding: 0; } :last-of-type { padding: 0; } p::first-letter { font-size: 1.5rem; font-weight: bold; color: brown; } ================================================ FILE: test/markup/css/pseudo.expect.txt ================================================ .test:before, .test:after { color: pink; color: red; } .test::before, .test::after { color: pink; color: red; } ================================================ FILE: test/markup/css/pseudo.txt ================================================ .test:before, .test:after { color: pink; color: red; } .test::before, .test::after { color: pink; color: red; } ================================================ FILE: test/markup/css/sample.expect.txt ================================================ @-ms-keyframes example { from {background-color: red;} to {background-color: yellow;} } @-o-keyframes example { from {background-color: red;} to {background-color: yellow;} } div.cls { color: rgba(51, 170, 51, .1); width: calc(100% - 80px); transform: rotate(45deg); } img { filter: grayscale(0.5) blur(10px); } a[href*="example"], * [lang^=en] { font-size: 2em; } @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } @media only screen and (orientation: landscape) { body { background-color: lightblue; } } @page :first { margin: 2cm; } @font-face { font-family: "Open Sans"; src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); } ================================================ FILE: test/markup/css/sample.txt ================================================ @-ms-keyframes example { from {background-color: red;} to {background-color: yellow;} } @-o-keyframes example { from {background-color: red;} to {background-color: yellow;} } div.cls { color: rgba(51, 170, 51, .1); width: calc(100% - 80px); transform: rotate(45deg); } img { filter: grayscale(0.5) blur(10px); } a[href*="example"], * [lang^=en] { font-size: 2em; } @supports (display: flex) { @media screen and (min-width: 900px) { article { display: flex; } } } @media only screen and (orientation: landscape) { body { background-color: lightblue; } } @page :first { margin: 2cm; } @font-face { font-family: "Open Sans"; src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"), url("/fonts/OpenSans-Regular-webfont.woff") format("woff"); } ================================================ FILE: test/markup/css/url.expect.txt ================================================ div { background: url("foo/bar/baz.jpg") } div { background: url('foo/bar/baz.jpg') } div { background: url(foo/bar/baz.jpg) } div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } // https://github.com/highlightjs/highlight.js/issues/3514 div { --custom-background-image-1: url('/appearance/themes/Dark+/image/background (01).jpg'); } ================================================ FILE: test/markup/css/url.txt ================================================ div { background: url("foo/bar/baz.jpg") } div { background: url('foo/bar/baz.jpg') } div { background: url(foo/bar/baz.jpg) } div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) } div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") } div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') } // https://github.com/highlightjs/highlight.js/issues/3514 div { --custom-background-image-1: url('/appearance/themes/Dark+/image/background (01).jpg'); } ================================================ FILE: test/markup/css/variables.expect.txt ================================================ body { --text-color: red; color: var(--text-color); } body { --textBlue: blue; color: var(--textBlue); } body { --_margin-top: 1rem; margin-top: var(--_margin-top); } ================================================ FILE: test/markup/css/variables.txt ================================================ body { --text-color: red; color: var(--text-color); } body { --textBlue: blue; color: var(--textBlue); } body { --_margin-top: 1rem; margin-top: var(--_margin-top); } ================================================ FILE: test/markup/d/default.expect.txt ================================================ #!/usr/bin/rdmd // Computes average line length for standard input. import std.stdio; /+ this is a /+ nesting +/ comment +/ enum COMPILED_ON = __TIMESTAMP__; // special token enum character = '©'; enum copy_valid = '&copy;'; enum backslash_escaped = '\\'; // string literals enum str = `hello "world"!`; enum multiline = r"lorem ipsum dolor"; // wysiwyg string, no escapes here allowed enum multiline2 = "sit amet \"adipiscing\" elit."; enum hex = x"66 6f 6f"; // same as "foo" #line 5 // float literals enum f = [3.14f, .1, 1., 1e100, 0xc0de.01p+100]; static if (something == true) { import std.algorithm; } void main() pure nothrow @safe { ulong lines = 0; double sumLength = 0; foreach (line; stdin.byLine()) { ++lines; sumLength += line.length; } writeln("Average line length: ", lines ? sumLength / lines : 0); } ================================================ FILE: test/markup/d/default.txt ================================================ #!/usr/bin/rdmd // Computes average line length for standard input. import std.stdio; /+ this is a /+ nesting +/ comment +/ enum COMPILED_ON = __TIMESTAMP__; // special token enum character = '©'; enum copy_valid = '©'; enum backslash_escaped = '\\'; // string literals enum str = `hello "world"!`; enum multiline = r"lorem ipsum dolor"; // wysiwyg string, no escapes here allowed enum multiline2 = "sit amet \"adipiscing\" elit."; enum hex = x"66 6f 6f"; // same as "foo" #line 5 // float literals enum f = [3.14f, .1, 1., 1e100, 0xc0de.01p+100]; static if (something == true) { import std.algorithm; } void main() pure nothrow @safe { ulong lines = 0; double sumLength = 0; foreach (line; stdin.byLine()) { ++lines; sumLength += line.length; } writeln("Average line length: ", lines ? sumLength / lines : 0); } ================================================ FILE: test/markup/dart/comment-markdown.expect.txt ================================================ /// Comment. /// Comment 2. /// ```dart /// code; /// ``` /// text. /// * bullet /// * sub-bullet /// code; /**/code; ================================================ FILE: test/markup/dart/comment-markdown.txt ================================================ /// Comment. /// Comment 2. /// ```dart /// code; /// ``` /// text. /// * bullet /// * sub-bullet /// code; /**/code; ================================================ FILE: test/markup/dart/string-interpolation.expect.txt ================================================ '1234$identifier $true'; // comment '1234${1234 + true + 'foo'}'; ================================================ FILE: test/markup/dart/string-interpolation.txt ================================================ '1234$identifier $true'; // comment '1234${1234 + true + 'foo'}'; ================================================ FILE: test/markup/delphi/character-string.expect.txt ================================================ const CDecimalCharacterString = #123; CHexadecimalCharacterString = #$7B; COctalCharacterString = #&123; CBinaryCharacterString = #%1111011; CDecimalCharacterStringWithSeparator = #1_23; CHexadecimalCharacterStringWithSeparator = #$7_B; COctalCharacterStringWithSeparator = #&123; CBinaryCharacterStringWithSeparator = #%1_111011; CMultipleCharacterStrings = #123#$ABC#&765#%0011001; ================================================ FILE: test/markup/delphi/character-string.txt ================================================ const CDecimalCharacterString = #123; CHexadecimalCharacterString = #$7B; COctalCharacterString = #&123; CBinaryCharacterString = #%1111011; CDecimalCharacterStringWithSeparator = #1_23; CHexadecimalCharacterStringWithSeparator = #$7_B; COctalCharacterStringWithSeparator = #&123; CBinaryCharacterStringWithSeparator = #%1_111011; CMultipleCharacterStrings = #123#$ABC#&765#%0011001; ================================================ FILE: test/markup/delphi/compiler-directive.expect.txt ================================================ { Compiler directives } {$I} (*$I*) procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF}); begin end; ================================================ FILE: test/markup/delphi/compiler-directive.txt ================================================ { Compiler directives } {$I} (*$I*) procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF}); begin end; ================================================ FILE: test/markup/delphi/numeric-literal.expect.txt ================================================ const CDecimal = 123456; CFloat = 123.456; CHexadecimal = $ABC123; COctal = &123456; CBinary = %000111; CDecimalWithSeparator = 123_456; CFloatWithSeparator = 12_3.78_9; CHexadecimalWithSeparator = $ABC_123; COctalWithSeparator = &123_456; CBinaryWithSeparator = %000_111; CHexadecimalWithOnlySeparator = $_; CBinaryWithOnlySeparator = %_; CHexadecimalWithNoDigits = $; CBinaryWithNoDigits = %; ================================================ FILE: test/markup/delphi/numeric-literal.txt ================================================ const CDecimal = 123456; CFloat = 123.456; CHexadecimal = $ABC123; COctal = &123456; CBinary = %000111; CDecimalWithSeparator = 123_456; CFloatWithSeparator = 12_3.78_9; CHexadecimalWithSeparator = $ABC_123; COctalWithSeparator = &123_456; CBinaryWithSeparator = %000_111; CHexadecimalWithOnlySeparator = $_; CBinaryWithOnlySeparator = %_; CHexadecimalWithNoDigits = $; CBinaryWithNoDigits = %; ================================================ FILE: test/markup/diff/comments.expect.txt ================================================ Index: languages/demo.js =================================================================== diff --git a/file.txt b/file.txt --- languages/demo.js (revision 199) +++ languages/demo.js (revision 200) @@ -1,8 +1,7 @@ + Here we highlight correctly ==== + Here too ===== + Here we don't anymore after five '=' next to each other ================================================ FILE: test/markup/diff/comments.txt ================================================ Index: languages/demo.js =================================================================== diff --git a/file.txt b/file.txt --- languages/demo.js (revision 199) +++ languages/demo.js (revision 200) @@ -1,8 +1,7 @@ + Here we highlight correctly ==== + Here too ===== + Here we don't anymore after five '=' next to each other ================================================ FILE: test/markup/diff/git-format-patch.expect.txt ================================================ diff --git a/file.py b/file.py index 123456..789abc 100644 --- a/file.py +++ b/file.py @@ -28,2 +28,2 @@ import logging + import shutil - import os diff --git a/file.txt b/file.txt index 123456..789abc 100644 --- a/file.txt --- b/file.txt @@ -28,2 +28,2 @@ - removal + addition diff --git a/file.txt b/file.txt index 8baef1b..24c5735 100644 --- a/file.txt +++ b/file.txt @@ -1 +1 @@ -removal +addition diff --git a/file.txt b/file.txt index f9308d8..f39c17d 100644 --- a/file.txt +++ b/file.txt @@ -1,2 +1 @@ -removal1 -removal2 +addition diff --git a/file.txt b/file.txt index 1037b05..54addbd 100644 --- a/file.txt +++ b/file.txt @@ -1 +1,2 @@ -removal +addition1 +addition2 ================================================ FILE: test/markup/diff/git-format-patch.txt ================================================ diff --git a/file.py b/file.py index 123456..789abc 100644 --- a/file.py +++ b/file.py @@ -28,2 +28,2 @@ import logging + import shutil - import os diff --git a/file.txt b/file.txt index 123456..789abc 100644 --- a/file.txt --- b/file.txt @@ -28,2 +28,2 @@ - removal + addition diff --git a/file.txt b/file.txt index 8baef1b..24c5735 100644 --- a/file.txt +++ b/file.txt @@ -1 +1 @@ -removal +addition diff --git a/file.txt b/file.txt index f9308d8..f39c17d 100644 --- a/file.txt +++ b/file.txt @@ -1,2 +1 @@ -removal1 -removal2 +addition diff --git a/file.txt b/file.txt index 1037b05..54addbd 100644 --- a/file.txt +++ b/file.txt @@ -1 +1,2 @@ -removal +addition1 +addition2 ================================================ FILE: test/markup/django/default.expect.txt ================================================ {% if articles|length %} {% for article in articles %} {% custom %} {# Striped table #} <tr class="{% cycle odd,even %}"> <td>{{ article|default:"Hi... " }}</td> <td {% if article.today %}class="today"{% endif %}> Published on {{ article.date }} </td> </tr> {% endfor %} {% endif %} ================================================ FILE: test/markup/django/default.txt ================================================ {% if articles|length %} {% for article in articles %} {% custom %} {# Striped table #} {{ article|default:"Hi... " }} Published on {{ article.date }} {% endfor %} {% endif %} ================================================ FILE: test/markup/dns/default.expect.txt ================================================ $ORIGIN example.com. ; designates the start of this zone file in the namespace $TTL 1h ; default expiration time of all resource records without their own TTL value example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h ) example.com. IN NS ns ; ns.example.com is a nameserver for example.com example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com @ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin @ IN MX 50 mail3 ; equivalent to above line, but using a relative host name example.com. IN A 192.0.2.1 ; IPv4 address for example.com IN AAAA 2001:db8:10::1 ; IPv6 address for example.com ns IN A 192.0.2.2 ; IPv4 address for ns.example.com IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com www IN CNAME example.com. ; www.example.com is an alias for example.com wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com mail IN A 192.0.2.3 ; IPv4 address for mail.example.com mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com ================================================ FILE: test/markup/dns/default.txt ================================================ $ORIGIN example.com. ; designates the start of this zone file in the namespace $TTL 1h ; default expiration time of all resource records without their own TTL value example.com. IN SOA ns.example.com. username.example.com. ( 2007120710 1d 2h 4w 1h ) example.com. IN NS ns ; ns.example.com is a nameserver for example.com example.com. IN NS ns.somewhere.example. ; ns.somewhere.example is a backup nameserver for example.com example.com. IN MX 10 mail.example.com. ; mail.example.com is the mailserver for example.com @ IN MX 20 mail2.example.com. ; equivalent to above line, "@" represents zone origin @ IN MX 50 mail3 ; equivalent to above line, but using a relative host name example.com. IN A 192.0.2.1 ; IPv4 address for example.com IN AAAA 2001:db8:10::1 ; IPv6 address for example.com ns IN A 192.0.2.2 ; IPv4 address for ns.example.com IN AAAA 2001:db8:10::2 ; IPv6 address for ns.example.com www IN CNAME example.com. ; www.example.com is an alias for example.com wwwtest IN CNAME www ; wwwtest.example.com is another alias for www.example.com mail IN A 192.0.2.3 ; IPv4 address for mail.example.com mail2 IN A 192.0.2.4 ; IPv4 address for mail2.example.com mail3 IN A 192.0.2.5 ; IPv4 address for mail3.example.com ================================================ FILE: test/markup/dockerfile/default.expect.txt ================================================ FROM ubuntu MAINTAINER laurent@docker.com ARG debug=0 COPY www.conf /etc/php5/fpm/pool.d/ RUN apt-get update \ && apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql RUN mkdir /tmp/sessions ENV APPLICATION_ENV dev USER www-data EXPOSE 80 VOLUME ["/var/www/html"] WORKDIR "/var/www/html" CMD [ "/usr/sbin/php5-fpm", "-F" ] ================================================ FILE: test/markup/dockerfile/default.txt ================================================ FROM ubuntu MAINTAINER laurent@docker.com ARG debug=0 COPY www.conf /etc/php5/fpm/pool.d/ RUN apt-get update \ && apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql RUN mkdir /tmp/sessions ENV APPLICATION_ENV dev USER www-data EXPOSE 80 VOLUME ["/var/www/html"] WORKDIR "/var/www/html" CMD [ "/usr/sbin/php5-fpm", "-F" ] ================================================ FILE: test/markup/dos/comments.expect.txt ================================================ rem comment rem comment copy a.txt b.txt > rem not_a_comment ================================================ FILE: test/markup/dos/comments.txt ================================================ rem comment rem comment copy a.txt b.txt > rem not_a_comment ================================================ FILE: test/markup/dsconfig/default.expect.txt ================================================ # Quoted and unquoted properties dsconfig create-client-connection-policy \ --policy-name "Restrictive Client Connection Policy" \ --set "description:Restrictive Client Connection Policy" \ --set enabled:true --set evaluation-order-index:1000 \ --set "connection-criteria:User.0 Connection Criteria" \ --set maximum-concurrent-connections:2 \ --set "maximum-connection-duration:1 s" \ --set "maximum-idle-connection-duration:1 s" \ --set maximum-operation-count-per-connection:1000 # dsconfig keyword is optional create-client-connection-policy \ --policy-name "Another Client Connection Policy" \ --set enabled:true --set evaluation-order-index:100 \ --set 'connection-criteria:User.1 Connection Criteria' \ # Property without value --reset maximum-concurrent-connections # Unquoted property, quoted property value dsconfig set-access-control-handler-prop \ --add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ --add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ --remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' # No continuation dsconfig delete-log-publisher --publisher-name "File-Based Error Logger" ================================================ FILE: test/markup/dsconfig/default.txt ================================================ # Quoted and unquoted properties dsconfig create-client-connection-policy \ --policy-name "Restrictive Client Connection Policy" \ --set "description:Restrictive Client Connection Policy" \ --set enabled:true --set evaluation-order-index:1000 \ --set "connection-criteria:User.0 Connection Criteria" \ --set maximum-concurrent-connections:2 \ --set "maximum-connection-duration:1 s" \ --set "maximum-idle-connection-duration:1 s" \ --set maximum-operation-count-per-connection:1000 # dsconfig keyword is optional create-client-connection-policy \ --policy-name "Another Client Connection Policy" \ --set enabled:true --set evaluation-order-index:100 \ --set 'connection-criteria:User.1 Connection Criteria' \ # Property without value --reset maximum-concurrent-connections # Unquoted property, quoted property value dsconfig set-access-control-handler-prop \ --add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ --add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \ --remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' # No continuation dsconfig delete-log-publisher --publisher-name "File-Based Error Logger" ================================================ FILE: test/markup/dts/default.expect.txt ================================================ /* * Copyright (C) 2011 - 2014 Xilinx * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ /include/ "skeleton.dtsi" / { compatible = "xlnx,zynq-7000"; pmu { compatible = "arm,cortex-a9-pmu"; interrupts = <0 5 4>, <0 6 4>; interrupt-parent = <&intc>; reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >; }; regulator_vccpint: fixedregulator@0 { compatible = "regulator-fixed"; regulator-name = "VCCPINT"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; regulator-boot-on; regulator-always-on; }; amba: amba { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&intc>; ranges; adc: adc@f8007100 { compatible = "xlnx,zynq-xadc-1.00.a"; reg = <0xf8007100 0x20>; interrupts = <0 7 4>; interrupt-parent = <&intc>; clocks = <&clkc 12>; }; i2c0: i2c@e0004000 { compatible = "cdns,i2c-r1p10"; status = "disabled"; clocks = <&clkc 38>; interrupt-parent = <&intc>; interrupts = <0 25 4>; reg = <0xe0004000 0x1000>; #address-cells = <1>; #size-cells = <0>; }; L2: cache-controller@f8f02000 { compatible = "arm,pl310-cache"; reg = <0xF8F02000 0x1000>; interrupts = <0 2 4>; arm,data-latency = <3 2 2>; arm,tag-latency = <2 2 2>; cache-unified; cache-level = <2>; }; }; }; ================================================ FILE: test/markup/dts/default.txt ================================================ /* * Copyright (C) 2011 - 2014 Xilinx * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ /include/ "skeleton.dtsi" / { compatible = "xlnx,zynq-7000"; pmu { compatible = "arm,cortex-a9-pmu"; interrupts = <0 5 4>, <0 6 4>; interrupt-parent = <&intc>; reg = < 0xf8891000 0x1000 0xf8893000 0x1000 >; }; regulator_vccpint: fixedregulator@0 { compatible = "regulator-fixed"; regulator-name = "VCCPINT"; regulator-min-microvolt = <1000000>; regulator-max-microvolt = <1000000>; regulator-boot-on; regulator-always-on; }; amba: amba { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&intc>; ranges; adc: adc@f8007100 { compatible = "xlnx,zynq-xadc-1.00.a"; reg = <0xf8007100 0x20>; interrupts = <0 7 4>; interrupt-parent = <&intc>; clocks = <&clkc 12>; }; i2c0: i2c@e0004000 { compatible = "cdns,i2c-r1p10"; status = "disabled"; clocks = <&clkc 38>; interrupt-parent = <&intc>; interrupts = <0 25 4>; reg = <0xe0004000 0x1000>; #address-cells = <1>; #size-cells = <0>; }; L2: cache-controller@f8f02000 { compatible = "arm,pl310-cache"; reg = <0xF8F02000 0x1000>; interrupts = <0 2 4>; arm,data-latency = <3 2 2>; arm,tag-latency = <2 2 2>; cache-unified; cache-level = <2>; }; }; }; ================================================ FILE: test/markup/dust/default.expect.txt ================================================ <h3>Hours</h3> <ul> {#users} <li {hello}>{firstName}</li>{~n} {/users} </ul> ================================================ FILE: test/markup/dust/default.txt ================================================

Hours

    {#users}
  • {firstName}
  • {~n} {/users}
================================================ FILE: test/markup/ebnf/quote-symbols.expect.txt ================================================ first_quote_symbol = "'" . second_quote_symbol = '"' . (* escaped_quote_symbol tests backticks, which does not interfere * with backslashes. It has precedent in some language * specifications. *) escaped_quote_symbol = `\` ( first_quote_symbol | second_quote_symbol ) . ================================================ FILE: test/markup/ebnf/quote-symbols.txt ================================================ first_quote_symbol = "'" . second_quote_symbol = '"' . (* escaped_quote_symbol tests backticks, which does not interfere * with backslashes. It has precedent in some language * specifications. *) escaped_quote_symbol = `\` ( first_quote_symbol | second_quote_symbol ) . ================================================ FILE: test/markup/ebnf/terminators.expect.txt ================================================ full-stop = "." . semicolon = ";" ; end-test = "end" ; (* ending production to test semicolon *) ================================================ FILE: test/markup/ebnf/terminators.txt ================================================ full-stop = "." . semicolon = ";" ; end-test = "end" ; (* ending production to test semicolon *) ================================================ FILE: test/markup/ebnf/underscore-production.expect.txt ================================================ a_production = nonterminal ; ================================================ FILE: test/markup/ebnf/underscore-production.txt ================================================ a_production = nonterminal ; ================================================ FILE: test/markup/elixir/char-literal.expect.txt ================================================ defguardp apostrophe?(c) when c == ?' defguardp upper?(c) when (c >= ?A and c <= ?Z) ================================================ FILE: test/markup/elixir/char-literal.txt ================================================ defguardp apostrophe?(c) when c == ?' defguardp upper?(c) when (c >= ?A and c <= ?Z) ================================================ FILE: test/markup/elixir/conditionals.expect.txt ================================================ case x do 1 -> :one 2 -> :two n when is_integer(n) -> :more _ -> :error end cond do x > 30 -> :ok y <= 7 -> :maybe z == :skip -> :ok true -> :error end if x > 4 do :ok end if x > 4, do: :ok if x > 4 do :ok else :error end if x > 4, do: :ok, else: :error unless y < 50 do :error end unless y < 50, do: :error unless y < 50 do :error else :ok end unless y < 50, do: :error, else: :ok ================================================ FILE: test/markup/elixir/conditionals.txt ================================================ case x do 1 -> :one 2 -> :two n when is_integer(n) -> :more _ -> :error end cond do x > 30 -> :ok y <= 7 -> :maybe z == :skip -> :ok true -> :error end if x > 4 do :ok end if x > 4, do: :ok if x > 4 do :ok else :error end if x > 4, do: :ok, else: :error unless y < 50 do :error end unless y < 50, do: :error unless y < 50 do :error else :ok end unless y < 50, do: :error, else: :ok ================================================ FILE: test/markup/elixir/function-not-regex.expect.txt ================================================ import Kernel, except: [ spawn: 1, +: 2, /: 2, unless: 2 ] ================================================ FILE: test/markup/elixir/function-not-regex.txt ================================================ import Kernel, except: [ spawn: 1, +: 2, /: 2, unless: 2 ] ================================================ FILE: test/markup/elixir/function-title.expect.txt ================================================ def f do :ok end def f(list) do :ok end def f :clear, list do :ok end def f!, do: IO.puts "hello world" defp f?, do: true defmacro foo, do: :ok defmacrop do_foo, do: :ok x = 5 ================================================ FILE: test/markup/elixir/function-title.txt ================================================ def f do :ok end def f(list) do :ok end def f :clear, list do :ok end def f!, do: IO.puts "hello world" defp f?, do: true defmacro foo, do: :ok defmacrop do_foo, do: :ok x = 5 ================================================ FILE: test/markup/elixir/module-references.expect.txt ================================================ hello |> IO.inspect() AnAtom My.Other.Atom My.Other.Atom.foo() NonStandard_Atom not_matched :not_matched.thing() :NotMatched? %MyStruct{a: 1} noModuleMatch ================================================ FILE: test/markup/elixir/module-references.txt ================================================ hello |> IO.inspect() AnAtom My.Other.Atom My.Other.Atom.foo() NonStandard_Atom not_matched :not_matched.thing() :NotMatched? %MyStruct{a: 1} noModuleMatch ================================================ FILE: test/markup/elixir/modules.expect.txt ================================================ defmodule User do defstruct [:name, :email, age: 18] end defprotocol Size do @doc "Calculates the size (and not the length!) of a data structure" def size(data) end defimpl Size, for: Map do def size(map), do: map_size(map) end ================================================ FILE: test/markup/elixir/modules.txt ================================================ defmodule User do defstruct [:name, :email, age: 18] end defprotocol Size do @doc "Calculates the size (and not the length!) of a data structure" def size(data) end defimpl Size, for: Map do def size(map), do: map_size(map) end ================================================ FILE: test/markup/elixir/numbers.expect.txt ================================================ integer = 1234 integer_with_leading_zero = 01234 integer_zero = 0 big_integer = 1_234_000 neg_integer = -20_000 float = 2.34 float_with_leading_zero = 0.34 float_zero = 0.0 sci_float = 2.4e23 plus_sci_float = 2.4e+23 small_sci_float = 2.4e-23 cap_sci_float = 2.4E23 binary = 0b1010 binary_with_leading_zero = 0b0010 strange_binary = 0b1010_1010_1010 octal = 0o777 octal_with_leading_zero = 0o077 strange_octal = 0o777_666_555 hex = 0x1ABEF hex_with_leading_zero = 0x0ABEF strange_hex = 0x1234_FACE_987D ================================================ FILE: test/markup/elixir/numbers.txt ================================================ integer = 1234 integer_with_leading_zero = 01234 integer_zero = 0 big_integer = 1_234_000 neg_integer = -20_000 float = 2.34 float_with_leading_zero = 0.34 float_zero = 0.0 sci_float = 2.4e23 plus_sci_float = 2.4e+23 small_sci_float = 2.4e-23 cap_sci_float = 2.4E23 binary = 0b1010 binary_with_leading_zero = 0b0010 strange_binary = 0b1010_1010_1010 octal = 0o777 octal_with_leading_zero = 0o077 strange_octal = 0o777_666_555 hex = 0x1ABEF hex_with_leading_zero = 0x0ABEF strange_hex = 0x1234_FACE_987D ================================================ FILE: test/markup/elixir/sigils.expect.txt ================================================ ~R'this + i\s "a" regex too' ~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s ~W(hello #{no "123" \c\d \123 interpol} world)s ~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here } ~S"No escapes \s\t\n and no #{interpolation}" ~S(No escapes \" \' \\ \a \b \d \e \f \n \r \s \t \v \0) ~s(Plenty of escapes \" \' \\ \a \b \d \e \f \n \r \s \t \v \0) ~S/hello/ ~S|hello| ~S"hello" ~S'hello' ~S(hello) ~S[hello] ~S{hello} ~S<hello> ~s/hello #{name}/ ~s|hello #{name}| ~s"hello #{name}" ~s'hello #{name}' ~s(hello #{name}) ~s[hello #{name}] ~s{hello #{name}} ~s<hello #{name}> ~r/hello/ ~r|hello|u ~r"hello"i ~r'hello'm ~r(hello)x ~r[hello]f ~r{hello}U ~r<hello> ~r<regex here>uismxfU ~r/regex here/uismxfU ~R<regex here>uismxfU ~R/regex here/uismxfU ~r|foo\|bar| ~R|foo\|bar| ~r(hello( there\)*!)u ~R(hello( there\)*!)u ~s|foo\|bar| ~S|foo\|bar| ================================================ FILE: test/markup/elixir/sigils.txt ================================================ ~R'this + i\s "a" regex too' ~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s ~W(hello #{no "123" \c\d \123 interpol} world)s ~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here } ~S"No escapes \s\t\n and no #{interpolation}" ~S(No escapes \" \' \\ \a \b \d \e \f \n \r \s \t \v \0) ~s(Plenty of escapes \" \' \\ \a \b \d \e \f \n \r \s \t \v \0) ~S/hello/ ~S|hello| ~S"hello" ~S'hello' ~S(hello) ~S[hello] ~S{hello} ~S ~s/hello #{name}/ ~s|hello #{name}| ~s"hello #{name}" ~s'hello #{name}' ~s(hello #{name}) ~s[hello #{name}] ~s{hello #{name}} ~s ~r/hello/ ~r|hello|u ~r"hello"i ~r'hello'm ~r(hello)x ~r[hello]f ~r{hello}U ~r ~ruismxfU ~r/regex here/uismxfU ~RuismxfU ~R/regex here/uismxfU ~r|foo\|bar| ~R|foo\|bar| ~r(hello( there\)*!)u ~R(hello( there\)*!)u ~s|foo\|bar| ~S|foo\|bar| ================================================ FILE: test/markup/elixir/strings.expect.txt ================================================ a = """ test """ b = ''' test ''' c = "test" d = 'test' ================================================ FILE: test/markup/elixir/strings.txt ================================================ a = """ test """ b = ''' test ''' c = "test" d = 'test' ================================================ FILE: test/markup/elixir/uppercase-string-sigil.expect.txt ================================================ defmodule Long.Module.Name do @doc ~S''' No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} ''' def func(a, b \\ []), do: :ok @doc ~S""" No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} """ def func(a, b \\ []), do: :ok end ================================================ FILE: test/markup/elixir/uppercase-string-sigil.txt ================================================ defmodule Long.Module.Name do @doc ~S''' No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} ''' def func(a, b \\ []), do: :ok @doc ~S""" No #{interpolation} of any kind. \000 \x{ff} \n #{\x{ff}} """ def func(a, b \\ []), do: :ok end ================================================ FILE: test/markup/elm/default.expect.txt ================================================ import Browser import Html exposing (div, button, text) import Html.Events exposing (onClick) type Msg = Increment main = Browser.sandbox { init = 0 , update = \msg model -> model + 1 , view = view } view model = div [] [ div [] [ text (String.fromInt model) ] , button [ onClick Increment ] [ text "+" ] ] chars = String.cons 'C' <| String.cons 'h' <| "ars" ================================================ FILE: test/markup/elm/default.txt ================================================ import Browser import Html exposing (div, button, text) import Html.Events exposing (onClick) type Msg = Increment main = Browser.sandbox { init = 0 , update = \msg model -> model + 1 , view = view } view model = div [] [ div [] [ text (String.fromInt model) ] , button [ onClick Increment ] [ text "+" ] ] chars = String.cons 'C' <| String.cons 'h' <| "ars" ================================================ FILE: test/markup/erb/default.expect.txt ================================================ <%# this is a comment %> <% @posts.each do |post| %> <p><%= link_to post.title, post %></p> <% end %> <%- available_things = things.select(&:available?) -%> <%%- x = 1 + 2 -%%> <%% value = 'real string #{@value}' %%> <%%= available_things.inspect %%> ================================================ FILE: test/markup/erb/default.txt ================================================ <%# this is a comment %> <% @posts.each do |post| %>

<%= link_to post.title, post %>

<% end %> <%- available_things = things.select(&:available?) -%> <%%- x = 1 + 2 -%%> <%% value = 'real string #{@value}' %%> <%%= available_things.inspect %%> ================================================ FILE: test/markup/erlang/char_literal.expect.txt ================================================ Character = $a TabCharacter = $\t TabCharacterDecimal = $\011 TextWithDollar = "This is just a normal text with a $ in the middle" StringStart = $" Backslash = $\\ ListStart = $[ ListEnd = $] SpaceChar = $ % yes, that works fun_takes_literal($a) -> ok. fun_takes_literal_list([$a|Rest]) -> ok. fun_takes_literal_binary(<<$a, Rest/binary>>) -> ok. convert_escape_sequence(<<$\\, Escaped, Rest/binary>>) -> C = case Escaped of $b -> $\b; $f -> $\f; $n -> $\n; $r -> $\r; $t -> $\t; $" -> $"; $\\ -> $\\; _ -> error end ================================================ FILE: test/markup/erlang/char_literal.txt ================================================ Character = $a TabCharacter = $\t TabCharacterDecimal = $\011 TextWithDollar = "This is just a normal text with a $ in the middle" StringStart = $" Backslash = $\\ ListStart = $[ ListEnd = $] SpaceChar = $ % yes, that works fun_takes_literal($a) -> ok. fun_takes_literal_list([$a|Rest]) -> ok. fun_takes_literal_binary(<<$a, Rest/binary>>) -> ok. convert_escape_sequence(<<$\\, Escaped, Rest/binary>>) -> C = case Escaped of $b -> $\b; $f -> $\f; $n -> $\n; $r -> $\r; $t -> $\t; $" -> $"; $\\ -> $\\; _ -> error end ================================================ FILE: test/markup/erlang/doc_attribute.expect.txt ================================================ -module(arith). -moduledoc """ A module for basic arithmetic. """. -export([add/2]). -doc "Adds two numbers.". add(One, Two) -> One + Two. ================================================ FILE: test/markup/erlang/doc_attribute.txt ================================================ -module(arith). -moduledoc """ A module for basic arithmetic. """. -export([add/2]). -doc "Adds two numbers.". add(One, Two) -> One + Two. ================================================ FILE: test/markup/erlang/maybe.expect.txt ================================================ maybe {ok, A} ?= a(), true = A >= 0, {ok, B} ?= b(), A + B else error -> error; wrong -> error end ================================================ FILE: test/markup/erlang/maybe.txt ================================================ maybe {ok, A} ?= a(), true = A >= 0, {ok, B} ?= b(), A + B else error -> error; wrong -> error end ================================================ FILE: test/markup/erlang/numbers.expect.txt ================================================ Integer = 1234 BigInteger = 1_234_000 NegInteger = -20_000 Float = 2.34 BigFloat = 3_333.14159_26535_89793 SciFloat = 2.4e23 PlusSciFloat = 2.4e+23 SmallSciFloat = 2.4e-23 Binary = 2#1010 StrangeBinary = 2#1010_1010_1010 Octal = 8#777 StrangeOctal = 8#777_666_555 Hex = 16#1ABEF StrangeHex = 16#1234_FACE_987D ================================================ FILE: test/markup/erlang/numbers.txt ================================================ Integer = 1234 BigInteger = 1_234_000 NegInteger = -20_000 Float = 2.34 BigFloat = 3_333.14159_26535_89793 SciFloat = 2.4e23 PlusSciFloat = 2.4e+23 SmallSciFloat = 2.4e-23 Binary = 2#1010 StrangeBinary = 2#1010_1010_1010 Octal = 8#777 StrangeOctal = 8#777_666_555 Hex = 16#1ABEF StrangeHex = 16#1234_FACE_987D ================================================ FILE: test/markup/erlang/sigil.expect.txt ================================================ greek_quote() -> S = ~B["Know thyself" (Greek: Γνῶθι σαυτόν)], io:format("~ts\n", [S]). ~'foo'. <<"\"\\µA\""/utf8>> = <<$",$\\,194,181,$A,$">> = ~b""" "\\µA" """ = ~b'"\\µA"' = ~B""" "\µA" """ = ~B<"\µA"> = ~""" "\µA" """ = ~"\"\\µA\"" = ~/"\\µA"/ quotes() -> S = ~""" "I always have a quotation for everything - it saves original thinking." - Dorothy L. Sayers "Real stupidity beats artificial intelligence every time." - Terry Pratchett """, io:put_chars(S), io:nl(). ~s{"abc\txyz"}. ~(parenthesis). ~<alligators>. ~`backticks`. ~#hashpounds#. ~|pipes|. ================================================ FILE: test/markup/erlang/sigil.txt ================================================ greek_quote() -> S = ~B["Know thyself" (Greek: Γνῶθι σαυτόν)], io:format("~ts\n", [S]). ~'foo'. <<"\"\\µA\""/utf8>> = <<$",$\\,194,181,$A,$">> = ~b""" "\\µA" """ = ~b'"\\µA"' = ~B""" "\µA" """ = ~B<"\µA"> = ~""" "\µA" """ = ~"\"\\µA\"" = ~/"\\µA"/ quotes() -> S = ~""" "I always have a quotation for everything - it saves original thinking." - Dorothy L. Sayers "Real stupidity beats artificial intelligence every time." - Terry Pratchett """, io:put_chars(S), io:nl(). ~s{"abc\txyz"}. ~(parenthesis). ~. ~`backticks`. ~#hashpounds#. ~|pipes|. ================================================ FILE: test/markup/erlang/triple_quote_string.expect.txt ================================================ quotes() -> S = """ "I always have a quotation for everything - it saves original thinking." - Dorothy L. Sayers "Real stupidity beats artificial intelligence every time." - Terry Pratchett """, io:put_chars(S), io:nl(). effect_warning() -> """ f() -> %% Test that the compiler warns for useless tuple building. {a,b,c}, ok. """. extra_delim() -> """"" """" """"". ================================================ FILE: test/markup/erlang/triple_quote_string.txt ================================================ quotes() -> S = """ "I always have a quotation for everything - it saves original thinking." - Dorothy L. Sayers "Real stupidity beats artificial intelligence every time." - Terry Pratchett """, io:put_chars(S), io:nl(). effect_warning() -> """ f() -> %% Test that the compiler warns for useless tuple building. {a,b,c}, ok. """. extra_delim() -> """"" """" """"". ================================================ FILE: test/markup/erlang-repl/default.expect.txt ================================================ 1> Str = "abcd". "abcd" 2> L = test:length(Str). 4 3> Descriptor = {L, list_to_atom(Str)}. {4,abcd} 4> L. 4 5> b(). Descriptor = {4,abcd} L = 4 Str = "abcd" ok 6> f(L). ok 7> b(). Descriptor = {4,abcd} Str = "abcd" ok 8> {L, _} = Descriptor. {4,abcd} 9> L. 4 10> 2#101. 5 11> 1.85e+3. 1850 ================================================ FILE: test/markup/erlang-repl/default.txt ================================================ 1> Str = "abcd". "abcd" 2> L = test:length(Str). 4 3> Descriptor = {L, list_to_atom(Str)}. {4,abcd} 4> L. 4 5> b(). Descriptor = {4,abcd} L = 4 Str = "abcd" ok 6> f(L). ok 7> b(). Descriptor = {4,abcd} Str = "abcd" ok 8> {L, _} = Descriptor. {4,abcd} 9> L. 4 10> 2#101. 5 11> 1.85e+3. 1850 ================================================ FILE: test/markup/excel/comments.expect.txt ================================================ =(N4 + N5)*0.055 + N("This is a comment.") ================================================ FILE: test/markup/excel/comments.txt ================================================ =(N4 + N5)*0.055 + N("This is a comment.") ================================================ FILE: test/markup/fix/default.expect.txt ================================================ 8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123 8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123  ================================================ FILE: test/markup/fix/default.txt ================================================ 8=FIX.4.2␁9=0␁35=8␁49=SENDERTEST␁56=TARGETTEST␁34=00000001526␁52=20120429-13:30:08.137␁1=ABC12345␁11=2012abc1234␁14=100␁17=201254321␁20=0␁30=NYSE␁31=108.20␁32=100␁38=100␁39=2␁40=1␁47=A␁54=5␁55=BRK␁59=2␁60=20120429-13:30:08.000␁65=B␁76=BROKER␁84=0␁100=NYSE␁111=100␁150=2␁151=0␁167=CS␁377=N␁10000=SampleCustomTag␁10=123␁ 8=FIX.4.29=035=849=SENDERTEST56=TARGETTEST34=0000000152652=20120429-13:30:08.1371=ABC1234511=2012abc123414=10017=20125432120=030=NYSE31=108.2032=10038=10039=240=147=A54=555=BRK59=260=20120429-13:30:08.00065=B76=BROKER84=0100=NYSE111=100150=2151=0167=CS377=N10000=SampleCustomTag10=123  ================================================ FILE: test/markup/flix/default.expect.txt ================================================ /** * An example of Flix for syntax highlighting. */ // Here is a namespace. namespace a.b.c { // Here are some literals. def b: Bool = true def c: Char = 'a' def f: Float = 1.23 def i: Int = 42 def s: Str = "string" // Here are some relations. rel LitStm(r: Str, c: Int) rel AddStm(r: Str, x: Str, y: Str) rel DivStm(r: Str, x: Str, y: Str) // Here is a lattice. lat LocalVar(k: Str, v: Constant) // Here is an index. index LitStm{{r}, {r, c}} // Here is an enum. enum Constant { case Top, case Cst(Int), case Bot } // Here is a function. def leq(e1: Constant, e2: Constant): Bool = match (e1, e2) with { case (Constant.Bot, _) => true case (Constant.Cst(n1), Constant.Cst(n2)) => n1 == n2 case (_, Constant.Top) => true case _ => false } // Here are some rules. LocalVar(r, alpha(c)) :- LitStm(r, c). LocalVar(r, sum(v1, v2)) :- AddStm(r, x, y), LocalVar(x, v1), LocalVar(y, v2). } ================================================ FILE: test/markup/flix/default.txt ================================================ /** * An example of Flix for syntax highlighting. */ // Here is a namespace. namespace a.b.c { // Here are some literals. def b: Bool = true def c: Char = 'a' def f: Float = 1.23 def i: Int = 42 def s: Str = "string" // Here are some relations. rel LitStm(r: Str, c: Int) rel AddStm(r: Str, x: Str, y: Str) rel DivStm(r: Str, x: Str, y: Str) // Here is a lattice. lat LocalVar(k: Str, v: Constant) // Here is an index. index LitStm{{r}, {r, c}} // Here is an enum. enum Constant { case Top, case Cst(Int), case Bot } // Here is a function. def leq(e1: Constant, e2: Constant): Bool = match (e1, e2) with { case (Constant.Bot, _) => true case (Constant.Cst(n1), Constant.Cst(n2)) => n1 == n2 case (_, Constant.Top) => true case _ => false } // Here are some rules. LocalVar(r, alpha(c)) :- LitStm(r, c). LocalVar(r, sum(v1, v2)) :- AddStm(r, x, y), LocalVar(x, v1), LocalVar(y, v2). } ================================================ FILE: test/markup/fortran/comments.expect.txt ================================================ !=============================== ! This is a test subroutine !=============================== ! another comment C=2 C = 2 !correct C ='boo' contains ================================================ FILE: test/markup/fortran/comments.txt ================================================ !=============================== ! This is a test subroutine !=============================== ! another comment C=2 C = 2 !correct C ='boo' contains ================================================ FILE: test/markup/fortran/dot_keywords.expect.txt ================================================ logical :: A=.true., B=.false., C=.true., D=.false. logical :: E E = 3 < 4 .and. B E = 'ij' <= 'ijk' .and. C E = B .or. A .and. D E = (B .or. A) .and. C E = A .and. .not.B ================================================ FILE: test/markup/fortran/dot_keywords.txt ================================================ logical :: A=.true., B=.false., C=.true., D=.false. logical :: E E = 3 < 4 .and. B E = 'ij' <= 'ijk' .and. C E = B .or. A .and. D E = (B .or. A) .and. C E = A .and. .not.B ================================================ FILE: test/markup/fortran/numbers.expect.txt ================================================ 1.d0 -1.d0 1.d-5 -1.D5 342.e+12 12. 12 .23 -.23 1.E4 1E4 1D-4 var1 va1r mo_tot_8 = 1./(0.4*log(float(elec_num_tot_8+0.4))) 6_ikind 1_c_short 6.666666666666666_DBL ================================================ FILE: test/markup/fortran/numbers.txt ================================================ 1.d0 -1.d0 1.d-5 -1.D5 342.e+12 12. 12 .23 -.23 1.E4 1E4 1D-4 var1 va1r mo_tot_8 = 1./(0.4*log(float(elec_num_tot_8+0.4))) 6_ikind 1_c_short 6.666666666666666_DBL ================================================ FILE: test/markup/fsharp/attributes.expect.txt ================================================ // Strings and numbers are highlighted inside the attribute [<Foo>] [<Bar("bar"); Foo(1, 2)>] let x () = () ================================================ FILE: test/markup/fsharp/attributes.txt ================================================ // Strings and numbers are highlighted inside the attribute [] [] let x () = () ================================================ FILE: test/markup/fsharp/bang-keywords.expect.txt ================================================ let! (result2 : byte[]) = stream.AsyncRead(bufferSize) ================================================ FILE: test/markup/fsharp/bang-keywords.txt ================================================ let! (result2 : byte[]) = stream.AsyncRead(bufferSize) ================================================ FILE: test/markup/fsharp/comments.expect.txt ================================================ (* here is a multi-line comment on one line *) (* here is a multi-line comment on multiple lines trying to break it: (**) /* asdf */ (* *) *) let index = len |> float |> Operators.(*) 0.1 // (*) here is not comment |> Operators.(+) 1 // (+) here is not comment |> Operators.(-) len // (-) here is not comment // foobar //bar (**) (*nospace*) (* space *) /// <summary> /// Class level summary documentation goes here. /// </summary> /// <remarks> /// Longer comments can be associated with a type or member through /// the remarks tag. /// </remarks> let x = () // the next one is not a comment (*) (*) /* this one is not a valid comment either */ ================================================ FILE: test/markup/fsharp/comments.txt ================================================ (* here is a multi-line comment on one line *) (* here is a multi-line comment on multiple lines trying to break it: (**) /* asdf */ (* *) *) let index = len |> float |> Operators.(*) 0.1 // (*) here is not comment |> Operators.(+) 1 // (+) here is not comment |> Operators.(-) len // (-) here is not comment // foobar //bar (**) (*nospace*) (* space *) /// /// Class level summary documentation goes here. /// /// /// Longer comments can be associated with a type or member through /// the remarks tag. /// let x = () // the next one is not a comment (*) (*) /* this one is not a valid comment either */ ================================================ FILE: test/markup/fsharp/computation-expressions.expect.txt ================================================ #r "nuget: Ply" open FSharp.Control.Tasks open System.Threading.Tasks // Single line, and contains a capital letter let unitTask = unitTask { return () } let work = async { let delayTask () = // Nested computation task { printfn "Delay..." do! Task.Delay 1000 return 42 } let! result = delayTask () |> Async.AwaitTask printfn "Async F# sleep..." do! Async.Sleep 1000 return result } let result = work |> Async.RunSynchronously ================================================ FILE: test/markup/fsharp/computation-expressions.txt ================================================ #r "nuget: Ply" open FSharp.Control.Tasks open System.Threading.Tasks // Single line, and contains a capital letter let unitTask = unitTask { return () } let work = async { let delayTask () = // Nested computation task { printfn "Delay..." do! Task.Delay 1000 return 42 } let! result = delayTask () |> Async.AwaitTask printfn "Async F# sleep..." do! Async.Sleep 1000 return result } let result = work |> Async.RunSynchronously ================================================ FILE: test/markup/fsharp/fsi-and-preprocessor.expect.txt ================================================ #if foo #else #endif #light #line #nowarn #if DEBUG // whitespace is allowed before let x = 0 #if DEBUG // but the preprocessor directive must be the first non-whitespace #IF asdf // should not match wrongly cased keywords #iftest // should not match #r "file.dll";; // Reference (dynamically load) the given DLL #i "package source uri";; // Include package source uri when searching for packages #I "path";; // Add the given search path for referenced DLLs #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #quit;; ================================================ FILE: test/markup/fsharp/fsi-and-preprocessor.txt ================================================ #if foo #else #endif #light #line #nowarn #if DEBUG // whitespace is allowed before let x = 0 #if DEBUG // but the preprocessor directive must be the first non-whitespace #IF asdf // should not match wrongly cased keywords #iftest // should not match #r "file.dll";; // Reference (dynamically load) the given DLL #i "package source uri";; // Include package source uri when searching for packages #I "path";; // Add the given search path for referenced DLLs #load "file.fs" ...;; // Load the given file(s) as if compiled and referenced #time ["on"|"off"];; // Toggle timing on/off #help;; // Display help #r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2' #r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version #quit;; ================================================ FILE: test/markup/fsharp/numbers.expect.txt ================================================ // There are multiple ways to write numbers. // Suffixes are currently not highlighted... 0xbabe 0xBABEun 0xflf 0xfLF 0b1001 0b1001y 0b1001uy 42 1.5 2.3E+32 2.3e-32 4.14F 4.14f 0.7833M 0.7833m 86y 86uy 86s 86us 86l 86u 86ul 86L 86UL 9999999999999999999999999999I // Distance, meters. [<Measure>] type m // Time, seconds. [<Measure>] type s let v1 = 3.1<m/s> let x1 = 1.2<m> let t1 = 1.0<s> ================================================ FILE: test/markup/fsharp/numbers.txt ================================================ // There are multiple ways to write numbers. // Suffixes are currently not highlighted... 0xbabe 0xBABEun 0xflf 0xfLF 0b1001 0b1001y 0b1001uy 42 1.5 2.3E+32 2.3e-32 4.14F 4.14f 0.7833M 0.7833m 86y 86uy 86s 86us 86l 86u 86ul 86L 86UL 9999999999999999999999999999I // Distance, meters. [] type m // Time, seconds. [] type s let v1 = 3.1 let x1 = 1.2 let t1 = 1.0 ================================================ FILE: test/markup/fsharp/operators.expect.txt ================================================ >= <= <> > < = + - * / % >=? <=? <>? >? <? =? +? -? *? /? %? ?>=? ?<=? ?<>? ?>? ?<? ?=? ?+? ?-? ?*? ?/? ?%? ?>= ?<= ?<> ?> ?< ?= ?+ ?- ?* ?/ ?% ** <- -> .. :: :> :? :?> << >> <<< >>> ~~~ ^^^ &&& ||| | || <| <|| <||| |> ||> |||> ~~ ~- ~+ ? ^ ! != == & && let array = [| 0 |] let anonymousRecord = {| x = 42 |} let range = [ for i in 0..10 -> i ] // Custom operators let inline (+?) (x: int) (y: int) = x + 2*y printf "%d" (10 +? 1) let inline (<!>) (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x let inline (<<|) (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x let inline (|>>) (x: '``Functor<'T>``) (f: 'T->'U) : '``Functor<'U>`` = Map.Invoke f x let inline (<*>) (f: '``Applicative<'T -> 'U>``) (x: '``Applicative<'T>``) : '``Applicative<'U>`` = Apply.Invoke f x let inline ( *>) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'U>`` = ((fun (_: 'T) (k: 'U) -> k) <!> x : '``Applicative<'U->'U>``) <*> y let inline (<* ) (x: '``Applicative<'U>``) (y: '``Applicative<'T>``): '``Applicative<'U>`` = ((fun (k: 'U) (_: 'T) -> k ) <!> x : '``Applicative<'T->'U>``) <*> y let inline (<**>) (x: '``Applicative<'T>``) : '``Applicative<'T -> 'U>``->'``Applicative<'U>`` = flip (<*>) x let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f let inline (=<<) (f: 'T->'``Monad<'U>``) (x: '``Monad<'T>``) : '``Monad<'U>`` = Bind.Invoke x f let inline (>=>) (f: 'T->'``Monad<'U>``) (g: 'U->'``Monad<'V>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g let inline (<=<) (g: 'b->'``Monad<'V>``) (f: 'T->'``Monad<'U>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g let inline (++) (x: 'Monoid) (y: 'Monoid) : 'Monoid = Plus.Invoke x y let inline (<|>) (x: '``Functor<'T>``) (y: '``Functor<'T>``) : '``Functor<'T>`` = Append.Invoke x y let inline (=>>) (s: '``Comonad<'T>``) (g: '``Comonad<'T>``->'U) : '``Comonad<'U>`` = Extend.Invoke g s // Code quotation open Microsoft.FSharp.Quotations // A typed code quotation. let expr : Expr<int> = <@ 1 + 1 @> // An untyped code quotation. let expr2 : Expr = <@@ 1 + 1 @@> // Active patterns let (|Integer|_|) (str: string) = let mutable intvalue = 0 if System.Int32.TryParse(str, &intvalue) then Some(intvalue) else None let (|Even|Odd|) input = if input % 2 = 0 then Even else Odd // ================================================ FILE: test/markup/fsharp/operators.txt ================================================ >= <= <> > < = + - * / % >=? <=? <>? >? =? ?<=? ?<>? ?>? ?= ?<= ?<> ?> ?< ?= ?+ ?- ?* ?/ ?% ** <- -> .. :: :> :? :?> << >> <<< >>> ~~~ ^^^ &&& ||| | || <| <|| <||| |> ||> |||> ~~ ~- ~+ ? ^ ! != == & && let array = [| 0 |] let anonymousRecord = {| x = 42 |} let range = [ for i in 0..10 -> i ] // Custom operators let inline (+?) (x: int) (y: int) = x + 2*y printf "%d" (10 +? 1) let inline () (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x let inline (<<|) (f: 'T->'U) (x: '``Functor<'T>``) : '``Functor<'U>`` = Map.Invoke f x let inline (|>>) (x: '``Functor<'T>``) (f: 'T->'U) : '``Functor<'U>`` = Map.Invoke f x let inline (<*>) (f: '``Applicative<'T -> 'U>``) (x: '``Applicative<'T>``) : '``Applicative<'U>`` = Apply.Invoke f x let inline ( *>) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'U>`` = ((fun (_: 'T) (k: 'U) -> k) x : '``Applicative<'U->'U>``) <*> y let inline (<* ) (x: '``Applicative<'U>``) (y: '``Applicative<'T>``): '``Applicative<'U>`` = ((fun (k: 'U) (_: 'T) -> k ) x : '``Applicative<'T->'U>``) <*> y let inline (<**>) (x: '``Applicative<'T>``) : '``Applicative<'T -> 'U>``->'``Applicative<'U>`` = flip (<*>) x let inline (>>=) (x: '``Monad<'T>``) (f: 'T->'``Monad<'U>``) : '``Monad<'U>`` = Bind.Invoke x f let inline (=<<) (f: 'T->'``Monad<'U>``) (x: '``Monad<'T>``) : '``Monad<'U>`` = Bind.Invoke x f let inline (>=>) (f: 'T->'``Monad<'U>``) (g: 'U->'``Monad<'V>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g let inline (<=<) (g: 'b->'``Monad<'V>``) (f: 'T->'``Monad<'U>``) : 'T -> '``Monad<'V>`` = fun x -> Bind.Invoke (f x) g let inline (++) (x: 'Monoid) (y: 'Monoid) : 'Monoid = Plus.Invoke x y let inline (<|>) (x: '``Functor<'T>``) (y: '``Functor<'T>``) : '``Functor<'T>`` = Append.Invoke x y let inline (=>>) (s: '``Comonad<'T>``) (g: '``Comonad<'T>``->'U) : '``Comonad<'U>`` = Extend.Invoke g s // Code quotation open Microsoft.FSharp.Quotations // A typed code quotation. let expr : Expr = <@ 1 + 1 @> // An untyped code quotation. let expr2 : Expr = <@@ 1 + 1 @@> // Active patterns let (|Integer|_|) (str: string) = let mutable intvalue = 0 if System.Int32.TryParse(str, &intvalue) then Some(intvalue) else None let (|Even|Odd|) input = if input % 2 = 0 then Even else Odd // ================================================ FILE: test/markup/fsharp/strings.expect.txt ================================================ // Different definitions of strings and character literals, // some with prefixes and suffixes (not all are currently highlighted) "" "fo\"o" "foo\ bar" "foo"B @"" @"foo" @"fo""o" @"foo"B """""" """fo""o" bar""" """foo"""B 'a' 'a'B '\'' '\\' '\231' '\x41' '\u0041' '\U0001F47D' $"{1+1}" "" // end "fo\"o" // end "foo\ // part of the string bar" // end "foo"B // end @"" // end @"foo" // end @"fo""o" // end @"foo"B // end """""" // end """fo""o" // part of the string bar""" // end """foo"""B // end 'a' // end 'a'B // end '\'' // end '\\' // end '\231' // end '\x41' // end '\u0041' // end '\U0001F47D' // end $"{1+1}" // end 0 "string \'" // end 1 "this string contains a new line" // end 2 "this string jumps a line\ but the result has no new line" // end 3 @"verbatim "" \' { string" // end 4 """triple quoted " \' { string""" // end 5 $"interpola\ {{ ted \' {1 + 1 // can contain comments and " in placeholders }string" // end 6 $@"interpolated "" \' {{ verbatim{1 + 1 // can contain comments and " in placeholders }string" // end 7 @$"interpolated "" \' {{ verbatim{1 + 1 // can contain comments and " in placeholders }string" // end 8 $"""interpolated triple quoted " \' {{ { (sprintf "%d%s" 42) // and " and comments... }string""" // end 9 $"""test { @"{it's not a placeholder!}" } asdf""" // end 10 $"""test { $"but this is:{1+1}" } asdf""" // end 11 $"interpola\ {{ ted \' {1 + 1 // can contain comments in placeholders // placeholders cannot contain " }string" // end 12 $@"interpolated "" \' {{ verbatim{1 + 1 // can contain comments in placeholders // placeholders cannot contain " }string" // end 13 $"""interpolated triple quoted " \' {{ { (sprintf "%d%s" 42) // can contain " // and comments... }string""" // end 14 let list = [1] $"""test{ list |> List.map (fun x -> x + 1) }test""" // end 15 $"test{1 (* " Does it break the string? " *) }test" // end 16 $"test\ { let x = 42 // valid comment contains " quote " ... x (* " Does it break the string? " *) }test" // end 17 $"""test { #if DEBUG #endif let asdf = "}" // """ does it break? let x = $@"test{2+2 (* " what about double nesting? " *) }test" let lit = 0 let x = unitTask { return () } asdf }test""" 18 let list = [1] $"""test { let asdf = "}" list |> List.map (fun x -> x + 1) }test""" // end 19 ================================================ FILE: test/markup/fsharp/strings.txt ================================================ // Different definitions of strings and character literals, // some with prefixes and suffixes (not all are currently highlighted) "" "fo\"o" "foo\ bar" "foo"B @"" @"foo" @"fo""o" @"foo"B """""" """fo""o" bar""" """foo"""B 'a' 'a'B '\'' '\\' '\231' '\x41' '\u0041' '\U0001F47D' $"{1+1}" "" // end "fo\"o" // end "foo\ // part of the string bar" // end "foo"B // end @"" // end @"foo" // end @"fo""o" // end @"foo"B // end """""" // end """fo""o" // part of the string bar""" // end """foo"""B // end 'a' // end 'a'B // end '\'' // end '\\' // end '\231' // end '\x41' // end '\u0041' // end '\U0001F47D' // end $"{1+1}" // end 0 "string \'" // end 1 "this string contains a new line" // end 2 "this string jumps a line\ but the result has no new line" // end 3 @"verbatim "" \' { string" // end 4 """triple quoted " \' { string""" // end 5 $"interpola\ {{ ted \' {1 + 1 // can contain comments and " in placeholders }string" // end 6 $@"interpolated "" \' {{ verbatim{1 + 1 // can contain comments and " in placeholders }string" // end 7 @$"interpolated "" \' {{ verbatim{1 + 1 // can contain comments and " in placeholders }string" // end 8 $"""interpolated triple quoted " \' {{ { (sprintf "%d%s" 42) // and " and comments... }string""" // end 9 $"""test { @"{it's not a placeholder!}" } asdf""" // end 10 $"""test { $"but this is:{1+1}" } asdf""" // end 11 $"interpola\ {{ ted \' {1 + 1 // can contain comments in placeholders // placeholders cannot contain " }string" // end 12 $@"interpolated "" \' {{ verbatim{1 + 1 // can contain comments in placeholders // placeholders cannot contain " }string" // end 13 $"""interpolated triple quoted " \' {{ { (sprintf "%d%s" 42) // can contain " // and comments... }string""" // end 14 let list = [1] $"""test{ list |> List.map (fun x -> x + 1) }test""" // end 15 $"test{1 (* " Does it break the string? " *) }test" // end 16 $"test\ { let x = 42 // valid comment contains " quote " ... x (* " Does it break the string? " *) }test" // end 17 $"""test { #if DEBUG #endif let asdf = "}" // """ does it break? let x = $@"test{2+2 (* " what about double nesting? " *) }test" let lit = 0 let x = unitTask { return () } asdf }test""" 18 let list = [1] $"""test { let asdf = "}" list |> List.map (fun x -> x + 1) }test""" // end 19 ================================================ FILE: test/markup/fsharp/types.expect.txt ================================================ // Testing type definition and type annotation highlighting: let test'test = 15 // compiles let bla = test'test // compiles type test'test<'a> = Test<'a> // compiles let ``type`` = "hello" // compiles let ``type` is a keyword but I can use it in my 'd funky \ \\ \n " ^d binding`` = "hello" // compiles // Type names (here with char) can be used to redefine bindings: let char : char = let char = box (char "a") let result = unbox<char> char try () with | :? ArgumentException -> failwith "..." result // All the following type annotation examples are valid F# type ``my = type`` = {a:string} let x : char array = [|'a'|] let f f' = f' () : 'returnType // the type annotation should end now and not color this as a type. let's end this with an end pattern: = let f (a: int, (b: string)) = () let f (a: int, b: string) = () let anonymousRecordAnnotation : {| X: string; Y: int array * string |} = ... let nested : {| X: string; Y: {| Nested: bool |} |} = () let test (a: {| X: string; (* this is a comment *) Y: {| Nested: bool |} |}) = () let f (a: (string[])) = a let f (a: int -> (unit -> string) -> string) (b: ('a -> 'b -> _ -> ``my = type`` -> {| Prop: '``quoted``|}) -> 'a list -> 'b list) = a let f (a: ('a -> 'b) -> 'a list -> 'b list -> (unit -> string) -> {| X: string |}) : _ * (int -> unit) = a, (fun x -> ()) let f (a: ('a -> 'b) // multiline! (currently not supported) -> {| X: (int -> {| Y: (string -> (unit (*this is getting*))(*really nested...*)); A: ``my = type`` |}) |} -> 'b list -> (unit -> string) -> {| X: string |}) = a let test : string (* this is a comment *) = ... let f (a: 'a when 'a : null, b: string) = () let iterate2 (f : unit -> #seq<int>) = for e in f() do printfn "%d" e type record = { X: int -> ('a -> 'b) -> (unit -> string) -> 'a list -> 'b list // comment Y: {| Bla: string (*comment*) array -> unit |} } type record = { X: string // comment Y: {| Bla: string (*comment*) array -> unit |} } type FancyClass(thing:int, var2 : string -> string, ``ddzdz``: string list, extra) as xxx = let pf() = xxx.Test() let mutable myInternalValue = null member xxx.Test() = "F#" // A read-only property. member __.MyReadOnlyProperty = myInternalValue // A write-only property. member __.MyWriteOnlyProperty with set (value) = myInternalValue <- value // A read-write property. member __.MyReadWriteProperty with get () = myInternalValue and set (value) = myInternalValue <- value member __.ReadAndWriteWithSignature with get (count : int) : string = string count and set (value : int) : unit = failwith "" member __.MyReadWriteProperty with get () = myInternalValue member __.MyReadWriteProperty with set (value) = myInternalValue <- value abstract Update : int * string * string option * obj -> FancyClass default this.Update (thing:int, var2 : string, ``name with spaces``: string option, extra) = this member val Property1 = thing member val Property2 = "" with get, set // Testing for generic parameters highlighting: type Ref<'a> = { mutable contents: 'a } type Bla<'a> = {X: string} type Blah< 'a > = { x: 'a } type Blah < 'a > = { x: 'a } type Bla <'a> = {X: string} let inline asdf x: Bla<'a> = {X = ""} let inline asdf x: Bla<^a> = {X = ""} let inline asdf x: Bla< ^a > = {X = ""} let a : '``asdf``_asdf = () // This is not valid and should not be parsed as a single generic type symbol type MyType<'T when 'T : null> = ... type MyType<'T when 'T : unmanaged> = ... type MyType<'T when 'T : (member Method1 : 'T -> int)> = ... type MyType<'T when 'T : delegate<obj * System.EventArgs, unit>> = ... let genericSumUnits ( x : float<'u>) (y: float<'u>) = x + y let inline konst x _ = x type CFunctor() = static member inline fmap (f: ^a -> ^b, a: ^a list) = List.map f a static member inline fmap (f: ^a -> ^b, a: ^a option) = match a with | None -> None | Some x -> Some (f x) // default implementation of replace static member inline replace< ^a, ^b, ^c, ^d, ^e when ^a :> CFunctor and (^a or ^d): (static member fmap: (^b -> ^c) * ^d -> ^e) > (a, f) = ((^a or ^d) : (static member fmap : (^b -> ^c) * ^d -> ^e) (konst a, f)) // call overridden replace if present static member inline replace< ^a, ^b, ^c when ^b: (static member replace: ^a * ^b -> ^c)>(a: ^a, f: ^b) = (^b : (static member replace: ^a * ^b -> ^c) (a, f)) let inline replace_instance< ^a, ^b, ^c, ^d when (^a or ^c): (static member replace: ^b * ^c -> ^d)> (a: ^b, f: ^c) = ((^a or ^c): (static member replace: ^b * ^c -> ^d) (a, f)) // Note the concrete type 'CFunctor' specified in the signature let inline replace (a: ^a) (f: ^b): ^a0 when (CFunctor or ^b): (static member replace: ^a * ^b -> ^a0) = replace_instance<CFunctor, _, _, _> (a, f) type DUType = | CaseA | CaseB of int | CaseC of (int * (string * string) list) | CaseD of name :string * age:int | CaseE of client: Client | CaseF of client: Client (*comment tests*) * (*comment tests*) string * port : int | CaseG of (obj -> unit) | CaseH of string * (obj -> unit) // Check multiple declaration on one line | CaseI of int | CaseJ of int | CaseF2 of client: Client // * string * port : int | FetchDomainsSuccess of Result<int list * ``type with spaces`` * int, ``type * with * spaces``> | CaseK of ``var with spaces``: string | CaseL of ``var with spaces``: ``type with spaces`` | CaseM of v1 : ``type with spaces`` | CaseN of ``type with spaces`` ================================================ FILE: test/markup/fsharp/types.txt ================================================ // Testing type definition and type annotation highlighting: let test'test = 15 // compiles let bla = test'test // compiles type test'test<'a> = Test<'a> // compiles let ``type`` = "hello" // compiles let ``type` is a keyword but I can use it in my 'd funky \ \\ \n " ^d binding`` = "hello" // compiles // Type names (here with char) can be used to redefine bindings: let char : char = let char = box (char "a") let result = unbox char try () with | :? ArgumentException -> failwith "..." result // All the following type annotation examples are valid F# type ``my = type`` = {a:string} let x : char array = [|'a'|] let f f' = f' () : 'returnType // the type annotation should end now and not color this as a type. let's end this with an end pattern: = let f (a: int, (b: string)) = () let f (a: int, b: string) = () let anonymousRecordAnnotation : {| X: string; Y: int array * string |} = ... let nested : {| X: string; Y: {| Nested: bool |} |} = () let test (a: {| X: string; (* this is a comment *) Y: {| Nested: bool |} |}) = () let f (a: (string[])) = a let f (a: int -> (unit -> string) -> string) (b: ('a -> 'b -> _ -> ``my = type`` -> {| Prop: '``quoted``|}) -> 'a list -> 'b list) = a let f (a: ('a -> 'b) -> 'a list -> 'b list -> (unit -> string) -> {| X: string |}) : _ * (int -> unit) = a, (fun x -> ()) let f (a: ('a -> 'b) // multiline! (currently not supported) -> {| X: (int -> {| Y: (string -> (unit (*this is getting*))(*really nested...*)); A: ``my = type`` |}) |} -> 'b list -> (unit -> string) -> {| X: string |}) = a let test : string (* this is a comment *) = ... let f (a: 'a when 'a : null, b: string) = () let iterate2 (f : unit -> #seq) = for e in f() do printfn "%d" e type record = { X: int -> ('a -> 'b) -> (unit -> string) -> 'a list -> 'b list // comment Y: {| Bla: string (*comment*) array -> unit |} } type record = { X: string // comment Y: {| Bla: string (*comment*) array -> unit |} } type FancyClass(thing:int, var2 : string -> string, ``ddzdz``: string list, extra) as xxx = let pf() = xxx.Test() let mutable myInternalValue = null member xxx.Test() = "F#" // A read-only property. member __.MyReadOnlyProperty = myInternalValue // A write-only property. member __.MyWriteOnlyProperty with set (value) = myInternalValue <- value // A read-write property. member __.MyReadWriteProperty with get () = myInternalValue and set (value) = myInternalValue <- value member __.ReadAndWriteWithSignature with get (count : int) : string = string count and set (value : int) : unit = failwith "" member __.MyReadWriteProperty with get () = myInternalValue member __.MyReadWriteProperty with set (value) = myInternalValue <- value abstract Update : int * string * string option * obj -> FancyClass default this.Update (thing:int, var2 : string, ``name with spaces``: string option, extra) = this member val Property1 = thing member val Property2 = "" with get, set // Testing for generic parameters highlighting: type Ref<'a> = { mutable contents: 'a } type Bla<'a> = {X: string} type Blah< 'a > = { x: 'a } type Blah < 'a > = { x: 'a } type Bla <'a> = {X: string} let inline asdf x: Bla<'a> = {X = ""} let inline asdf x: Bla<^a> = {X = ""} let inline asdf x: Bla< ^a > = {X = ""} let a : '``asdf``_asdf = () // This is not valid and should not be parsed as a single generic type symbol type MyType<'T when 'T : null> = ... type MyType<'T when 'T : unmanaged> = ... type MyType<'T when 'T : (member Method1 : 'T -> int)> = ... type MyType<'T when 'T : delegate> = ... let genericSumUnits ( x : float<'u>) (y: float<'u>) = x + y let inline konst x _ = x type CFunctor() = static member inline fmap (f: ^a -> ^b, a: ^a list) = List.map f a static member inline fmap (f: ^a -> ^b, a: ^a option) = match a with | None -> None | Some x -> Some (f x) // default implementation of replace static member inline replace< ^a, ^b, ^c, ^d, ^e when ^a :> CFunctor and (^a or ^d): (static member fmap: (^b -> ^c) * ^d -> ^e) > (a, f) = ((^a or ^d) : (static member fmap : (^b -> ^c) * ^d -> ^e) (konst a, f)) // call overridden replace if present static member inline replace< ^a, ^b, ^c when ^b: (static member replace: ^a * ^b -> ^c)>(a: ^a, f: ^b) = (^b : (static member replace: ^a * ^b -> ^c) (a, f)) let inline replace_instance< ^a, ^b, ^c, ^d when (^a or ^c): (static member replace: ^b * ^c -> ^d)> (a: ^b, f: ^c) = ((^a or ^c): (static member replace: ^b * ^c -> ^d) (a, f)) // Note the concrete type 'CFunctor' specified in the signature let inline replace (a: ^a) (f: ^b): ^a0 when (CFunctor or ^b): (static member replace: ^a * ^b -> ^a0) = replace_instance (a, f) type DUType = | CaseA | CaseB of int | CaseC of (int * (string * string) list) | CaseD of name :string * age:int | CaseE of client: Client | CaseF of client: Client (*comment tests*) * (*comment tests*) string * port : int | CaseG of (obj -> unit) | CaseH of string * (obj -> unit) // Check multiple declaration on one line | CaseI of int | CaseJ of int | CaseF2 of client: Client // * string * port : int | FetchDomainsSuccess of Result | CaseK of ``var with spaces``: string | CaseL of ``var with spaces``: ``type with spaces`` | CaseM of v1 : ``type with spaces`` | CaseN of ``type with spaces`` ================================================ FILE: test/markup/gams/default.expect.txt ================================================ SETS I canning plants / SEATTLE, SAN-DIEGO / J markets / NEW-YORK, CHICAGO, TOPEKA / ; PARAMETERS A(I) capacity of plant i in cases / SEATTLE 350 SAN-DIEGO 600 / B(J) demand at market j in cases / NEW-YORK 325 CHICAGO 300 TOPEKA 275 / ; TABLE D(I,J) distance in thousands of miles NEW-YORK CHICAGO TOPEKA SEATTLE 2.5 1.7 1.8 SAN-DIEGO 2.5 1.8 1.4 ; SCALAR F freight in dollars per case per thousand miles /90/ ; PARAMETER C(I,J) transport cost in thousands of dollars per case ; C(I,J) = F * D(I,J) / 1000 ; VARIABLES X(I,J) shipment quantities in cases Z total transportation costs in thousands of dollars ; POSITIVE VARIABLE X ; EQUATIONS COST define objective function SUPPLY(I) observe supply limit at plant i DEMAND(J) satisfy demand at market j ; COST .. Z =E= SUM((I,J), C(I,J)*X(I,J)) ; SUPPLY(I) .. SUM(J, X(I,J)) =L= A(I) ; DEMAND(J) .. SUM(I, X(I,J)) =G= B(J) ; MODEL TRANSPORT /ALL/ ; SOLVE TRANSPORT USING LP MINIMIZING Z ; ================================================ FILE: test/markup/gams/default.txt ================================================ SETS I canning plants / SEATTLE, SAN-DIEGO / J markets / NEW-YORK, CHICAGO, TOPEKA / ; PARAMETERS A(I) capacity of plant i in cases / SEATTLE 350 SAN-DIEGO 600 / B(J) demand at market j in cases / NEW-YORK 325 CHICAGO 300 TOPEKA 275 / ; TABLE D(I,J) distance in thousands of miles NEW-YORK CHICAGO TOPEKA SEATTLE 2.5 1.7 1.8 SAN-DIEGO 2.5 1.8 1.4 ; SCALAR F freight in dollars per case per thousand miles /90/ ; PARAMETER C(I,J) transport cost in thousands of dollars per case ; C(I,J) = F * D(I,J) / 1000 ; VARIABLES X(I,J) shipment quantities in cases Z total transportation costs in thousands of dollars ; POSITIVE VARIABLE X ; EQUATIONS COST define objective function SUPPLY(I) observe supply limit at plant i DEMAND(J) satisfy demand at market j ; COST .. Z =E= SUM((I,J), C(I,J)*X(I,J)) ; SUPPLY(I) .. SUM(J, X(I,J)) =L= A(I) ; DEMAND(J) .. SUM(I, X(I,J)) =G= B(J) ; MODEL TRANSPORT /ALL/ ; SOLVE TRANSPORT USING LP MINIMIZING Z ; ================================================ FILE: test/markup/gauss/function_defs.expect.txt ================================================ proc (1) = foo(if, endif, 10); proc foo; proc (1) = calc(local__row, fin, ...); fn /* inline */ twopi=pi*2; fn _n_pi(n /* inline comment */) = pi*n; keyword add(str, struct plotControl myPlot); keyword sub; ================================================ FILE: test/markup/gauss/function_defs.txt ================================================ proc (1) = foo(if, endif, 10); proc foo; proc (1) = calc(local__row, fin, ...); fn /* inline */ twopi=pi*2; fn _n_pi(n /* inline comment */) = pi*n; keyword add(str, struct plotControl myPlot); keyword sub; ================================================ FILE: test/markup/gauss/function_refs.expect.txt ================================================ k = colsf(fin); nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); ols("", csvReadM("test.csv")); if myfn(10) == 20; ================================================ FILE: test/markup/gauss/function_refs.txt ================================================ k = colsf(fin); nr = floor(minc(maxbytes/(k*8*3.5)|maxvec/(k+1))); call random_user_function_2(-10.0, "hey", /* blah */ x[0x2F]); ols("", csvReadM("test.csv")); if myfn(10) == 20; ================================================ FILE: test/markup/gauss/keywords.expect.txt ================================================ for i(start, stop, bar(5)); if (i-1 % 5 == 0 .and some_flag); elseif i % 2 .eqv 0; external string _olsrnam; external proc indices2,indexcat; myPlot.axes.and.for.if.endif.text = "hey"; local f:proc; ================================================ FILE: test/markup/gauss/keywords.txt ================================================ for i(start, stop, bar(5)); if (i-1 % 5 == 0 .and some_flag); elseif i % 2 .eqv 0; external string _olsrnam; external proc indices2,indexcat; myPlot.axes.and.for.if.endif.text = "hey"; local f:proc; ================================================ FILE: test/markup/gcode/default.expect.txt ================================================ O003 (DIAMOND SQUARE) N2 G54 G90 G49 G80 N3 M6 T1 (1.ENDMILL) N4 M3 S1800 N5 G0 X-.6 Y2.050 N6 G43 H1 Z.1 N7 G1 Z-.3 F50. N8 G41 D1 Y1.45 N9 G1 X0 F20. N10 G2 J-1.45 (CUTTER COMP CANCEL) N11 G1 Z-.2 F50. N12 Y-.990 N13 G40 N14 G0 X-.6 Y1.590 N15 G0 Z.1 N16 M5 G49 G28 G91 Z0 N17 CALL O9456 N18 #500=0.004 N19 #503=[#500+#501] N20 VC45=0.0006 VS4=0.0007 N21 G90 G10 L20 P3 X5.Y4. Z6.567 N22 G0 X5000 N23 IF [#1 LT 0.370] GOTO 49 N24 X-0.678 Y+.990 N25 G84.3 X-0.1 N26 #4=#5*COS[45] N27 #4=#5*SIN[45] N28 VZOFZ=652.9658 % ================================================ FILE: test/markup/gcode/default.txt ================================================ O003 (DIAMOND SQUARE) N2 G54 G90 G49 G80 N3 M6 T1 (1.ENDMILL) N4 M3 S1800 N5 G0 X-.6 Y2.050 N6 G43 H1 Z.1 N7 G1 Z-.3 F50. N8 G41 D1 Y1.45 N9 G1 X0 F20. N10 G2 J-1.45 (CUTTER COMP CANCEL) N11 G1 Z-.2 F50. N12 Y-.990 N13 G40 N14 G0 X-.6 Y1.590 N15 G0 Z.1 N16 M5 G49 G28 G91 Z0 N17 CALL O9456 N18 #500=0.004 N19 #503=[#500+#501] N20 VC45=0.0006 VS4=0.0007 N21 G90 G10 L20 P3 X5.Y4. Z6.567 N22 G0 X5000 N23 IF [#1 LT 0.370] GOTO 49 N24 X-0.678 Y+.990 N25 G84.3 X-0.1 N26 #4=#5*COS[45] N27 #4=#5*SIN[45] N28 VZOFZ=652.9658 % ================================================ FILE: test/markup/gcode/extended.expect.txt ================================================ %; something important ; another comment (yet another more different comment) ( multi line madness ) M500; comment after code M500 (comment after code) O<boring> SUB #20 = [#1 * SIN[#1]] #21 = [-#2 * COS[#2]] #22 = [#3 / COS[#3]] #23 = [#4 + #4 - #4] #24 = [[#5 - #5] * TAN[#5]] #25=FIX[#101/2.75] #26=ROUND[#104] #27=ABS[#104] ; WITH SANE SPACING N1 O107 IF [#10 GT 5] N2 G0 A0 B0 C0 U0 V0 W0 X0 Y0 Z0 *71 N3 G100 A100 B0 N4 G5.2 A10.2 B0 N5 G100 A.2 B0 N6 G100 A-.2 B0 N7 G100 A+.2 B0 N8 T0 N9 M100 F1 H2 I3 J4 K5 P6 Q7 R8 S9 N10 M587 S"MYROUTER" P"ABCxyz;" "123" N10 O107 ENDIF ; WITH EXCESSIVE SPACING O 108 IF [#10 GT 5] N 102 G 0 A 0 B 0 C 0 U 0 V 0 W 0 X 0 Y 0 Z 0 *71 N 103 G 100 A 100 B 0 N 104 G 5.2 A 10.2 B 0 N 105 G 100 A .2 B 0 N 106 G 100 A -.2 B 0 N 107 G 100 A +.2 B 0 N 108 T 0 N 109 M 100 F 1 H 2 I 3 J 4 K 5 P 6 Q 7 R 8 S 9 N 110 M 587 S "MYROUTER" P "ABCxyz;" "123" O 108 ENDIF ; WITHOUT SPACING O109IF[#10GT5] N202G0A0B0C0U0V0W0X0Y0Z0*71 N203G100A100B0 N204G5.2A10.2B0 N205G100A.2B0 N206G100A-.2B0 N207G100A+.2B0 N208T0 N209M100F1H2I3J4K5P6Q7R8S9 N210M587S"MYROUTER"P"ABCxyz;""123" O109ENDIF O<boring> ENDSUB O<boring> CALL [1] [2] [3] [4] [5] ; Words as seen in Klipper Firmware GCode GET_RETRACTION TURN_OFF_HEATERS MANUAL_STEPPER STEPPER=config_name ENABLE=0 SET_POSITION=11.1 SPEED=22.2 ACCEL=33.3 MOVE=44.4 STOP_ON_ENDSTOP=-1 SYNC=0 SET_SKEW XY=100.0000,100.0000,70.7107 SKEW_PROFILE SAVE="this name has spaces" SAVE_CONFIG SKEW_PROFILE SAVE=some_ G123 SKEW_PROFILE SAVE=some_G123 % ================================================ FILE: test/markup/gcode/extended.txt ================================================ %; something important ; another comment (yet another more different comment) ( multi line madness ) M500; comment after code M500 (comment after code) O SUB #20 = [#1 * SIN[#1]] #21 = [-#2 * COS[#2]] #22 = [#3 / COS[#3]] #23 = [#4 + #4 - #4] #24 = [[#5 - #5] * TAN[#5]] #25=FIX[#101/2.75] #26=ROUND[#104] #27=ABS[#104] ; WITH SANE SPACING N1 O107 IF [#10 GT 5] N2 G0 A0 B0 C0 U0 V0 W0 X0 Y0 Z0 *71 N3 G100 A100 B0 N4 G5.2 A10.2 B0 N5 G100 A.2 B0 N6 G100 A-.2 B0 N7 G100 A+.2 B0 N8 T0 N9 M100 F1 H2 I3 J4 K5 P6 Q7 R8 S9 N10 M587 S"MYROUTER" P"ABCxyz;" "123" N10 O107 ENDIF ; WITH EXCESSIVE SPACING O 108 IF [#10 GT 5] N 102 G 0 A 0 B 0 C 0 U 0 V 0 W 0 X 0 Y 0 Z 0 *71 N 103 G 100 A 100 B 0 N 104 G 5.2 A 10.2 B 0 N 105 G 100 A .2 B 0 N 106 G 100 A -.2 B 0 N 107 G 100 A +.2 B 0 N 108 T 0 N 109 M 100 F 1 H 2 I 3 J 4 K 5 P 6 Q 7 R 8 S 9 N 110 M 587 S "MYROUTER" P "ABCxyz;" "123" O 108 ENDIF ; WITHOUT SPACING O109IF[#10GT5] N202G0A0B0C0U0V0W0X0Y0Z0*71 N203G100A100B0 N204G5.2A10.2B0 N205G100A.2B0 N206G100A-.2B0 N207G100A+.2B0 N208T0 N209M100F1H2I3J4K5P6Q7R8S9 N210M587S"MYROUTER"P"ABCxyz;""123" O109ENDIF O ENDSUB O CALL [1] [2] [3] [4] [5] ; Words as seen in Klipper Firmware GCode GET_RETRACTION TURN_OFF_HEATERS MANUAL_STEPPER STEPPER=config_name ENABLE=0 SET_POSITION=11.1 SPEED=22.2 ACCEL=33.3 MOVE=44.4 STOP_ON_ENDSTOP=-1 SYNC=0 SET_SKEW XY=100.0000,100.0000,70.7107 SKEW_PROFILE SAVE="this name has spaces" SAVE_CONFIG SKEW_PROFILE SAVE=some_ G123 SKEW_PROFILE SAVE=some_G123 % ================================================ FILE: test/markup/gherkin/default.expect.txt ================================================ # language: en Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers @this_is_a_tag Scenario Outline: Add two numbers * I have a calculator Given I have entered <input_1> into the calculator And I have entered <input_2> into the calculator When I press <button> Then the result should be <output> on the screen And I have a string like """ Here is some multiline text """ Examples: | input_1 | input_2 | button | output | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 | ================================================ FILE: test/markup/gherkin/default.txt ================================================ # language: en Feature: Addition In order to avoid silly mistakes As a math idiot I want to be told the sum of two numbers @this_is_a_tag Scenario Outline: Add two numbers * I have a calculator Given I have entered into the calculator And I have entered into the calculator When I press Language: Theme:

Rendered in ... ms [...]

...

Markup

...
================================================ FILE: tools/lib/bundling.js ================================================ const rollup = require('rollup'); const crypto = require("crypto"); async function rollupCode(inputOptions, outputOptions) { const output = await generate(inputOptions, outputOptions); return output[0].code; } async function generate(inputOptions, outputOptions) { const bundle = await rollup.rollup(inputOptions).catch(err => console.log(err)); const { output } = await bundle.generate(outputOptions); return output; } async function rollupWrite(inputOptions, outputOptions) { const bundle = await rollup.rollup(inputOptions).catch(err => console.log(err)); await bundle.generate(outputOptions); await bundle.write(outputOptions); } function sha384(contents) { const hash = crypto.createHash('sha384'); const data = hash.update(contents, 'utf-8'); const gen_hash = data.digest('base64'); return `sha384-${gen_hash}`; } module.exports = { rollupWrite, rollupCode, sha384 }; ================================================ FILE: tools/lib/dependencies.js ================================================ const DependencyResolver = require('dependency-resolver'); /** * Reorders languages, moving dependencies above the languages * that depend on them. * * @param {array} languages list of languages to be reordered * @returns {array} ordered list of languages */ const reorderDependencies = (languages) => { const resolver = new DependencyResolver(); for (const lang of languages) { resolver.add(lang.name); for (const required of lang.requires) { resolver.setDependency(lang.name, required); } } return resolver.sort().map((name) => languages.find((l) => l.name === name) ); }; /** * Filters languages by group (common, etc) * * Groups are currently defined inside each language file with `Category` * * @param {array} languages full list of languages * @returns {array} filtered list */ const languagesByGroup = (languages, groupIdentifier) => { const groupName = groupIdentifier.replace(":", ""); return languages.filter((el) => el.categories.includes(groupName)); }; // :common is a group identifier, "common" is the group name const isGroup = (id) => id[0] === ":"; /** * Filters languages by a list of languages or categories * * This also resolves any requires and dependency ordering issues. * The returned list can be registered sequentially and should "just work". * * @param {array} allLanguages - full list of languages * @param {array} includes - which languages or groups to include * example: ":common elixir ruby" * @returns {array} filtered list if languages */ const filter = (allLanguages, includes) => { if (!includes || includes.length === 0) { return reorderDependencies(allLanguages); } let languages = []; for (const item of includes) { if (isGroup(item)) { languages = languages.concat(languagesByGroup(allLanguages, item)); } else { const languageName = item; const found = allLanguages.find((el) => el.name === languageName); if (found) { languages.push(found); } else { console.error(`[ERROR] Language '${languageName}' could not be found.`); process.exit(1); } } } // resolve requires for (const lang of languages) { lang.requires.forEach(needed => { if (!languages.find((el) => el.name === needed)) { console.info(`[INFO] Adding ${needed}... ${lang.name} requires ${needed}.`); languages.push(allLanguages.find((el) => el.name === needed)); } }); } // make sure our dependencies are in the correct order return reorderDependencies(languages); }; module.exports = { reorderDependencies, filter }; ================================================ FILE: tools/lib/external_language.js ================================================ const fs = require("fs"); const fsProm = require("fs").promises; const glob = require("glob-promise"); const path = require("path"); const MODULE_DEFINER = /module\.exports\.definer\s*=/; class LanguagePackage { constructor(packageDir) { this.dir = packageDir; } // check for language modules in /src/languages async trySrcLanguages() { const dir = path.join(this.dir, "src/languages/*"); const languages = await glob(dir); if (languages.length > 0) { this.files = languages.map(fn => `./${fn}`); this.names = this.files.map(fn => path.basename(fn, ".js")); this._bundle = true; this._valid = true; return true; } else { return false; } } get markupTestPaths() { if (this.bundle) { return this.names.map(name => `${this.dir}/test/markup/${name}`); } else { return [`${this.dir}/test/markup`]; } } get detectTestPaths() { if (this.bundle) { return this.names.map(name => `${this.dir}/test/detect/${name}`); } else { return [`${this.dir}/test/detect`]; } } // try to find a language module by probing package.json async tryPackageJSON() { const pack = path.join(this.dir, "package.json"); if (fs.existsSync(pack)) { const data = await fsProm.readFile(pack); const json = JSON.parse(data); if (json.main) { this.type = "npm"; const file = path.join(process.cwd(), this.dir, json.main); const content = await fsProm.readFile(file, { encoding: "utf8" }); // many existing languages seem to export a `definer` function rather than // simply export the language module directly. This checks for that and if // so allows those existing modules to work "as is" by allowing the build // system to know it should call `definer` to define the language not call // the default export if (content.match(MODULE_DEFINER)) { this.loader = "definer"; } this.files = [file]; this.names = [path.basename(file, ".js")]; this._valid = true; return true; } } } get bundle() { return this._bundle; } async detect() { // any bundle with files in ROOT/src/languages/ will be considered a potential // multi language bundle and any files in that directy will be considered to be // language modules await this.trySrcLanguages() // otherwise we fall back to looking for a package.json and whatever it's // `main` entry point is that is the file we assume the language module is // defined in || await this.tryPackageJSON(); this._detected = true; } async valid() { if (!this._detected) { await this.detect(); } return this._valid; } } // third party language modules are dropped into the `highlight-js/extra` // folder and will be auto-detected by the build system async function getThirdPartyPackages() { const packages = []; const otherPackages = await glob("./extra/*"); for (const packageDir of otherPackages) { const thirdPartyPackage = new LanguagePackage(packageDir); const valid = await thirdPartyPackage.valid(); if (valid) { packages.push(thirdPartyPackage); } } return packages; } module.exports = { LanguagePackage, getThirdPartyPackages }; ================================================ FILE: tools/lib/language.js ================================================ const fs = require("fs"); const Terser = require("terser"); const glob = require("glob"); const path = require("path"); const build_config = require("../build_config.js"); const packageJSON = require("../../package.json"); const REQUIRES_REGEX = /\/\*.*?Requires: (.*?)\r?\n/s; const CATEGORY_REGEX = /\/\*.*?Category: (.*?)\r?\n/s; const LANGUAGE_REGEX = /\/\*.*?Language: (.*?)\r?\n/s; const { rollupCode } = require("./bundling.js"); const { getThirdPartyPackages } = require("./external_language.js"); class Language { constructor(name, path) { this.name = name; this.prettyName = name; this.requires = []; this.categories = []; this.third_party = false; // compiled code this.module = ""; this.minified = ""; this.path = path; this.data = fs.readFileSync(path, { encoding: "utf8" }); this.loadMetadata(); } async compile(options) { await compileLanguage(this, options); return this; } get sample() { if (this._sample) return this._sample; this._sample = ""; if (fs.existsSync(this.samplePath)) { this._sample = fs.readFileSync(this.samplePath, { encoding: "utf8" }); } return this._sample; } get samplePath() { if (this.moduleDir) { // this is the 'extras' case. return `${this.moduleDir}/test/detect/${this.name}/default.txt`; } else { // this is the common/built-in case. return `./test/detect/${this.name}/default.txt`; } } loadMetadata() { const requiresMatch = REQUIRES_REGEX.exec(this.data); const categoryMatch = CATEGORY_REGEX.exec(this.data); const languageMatch = LANGUAGE_REGEX.exec(this.data); if (requiresMatch) { this.requires = requiresMatch[1] .split(", ") .map((n) => n.replace(".js", "")) .filter(n => n.trim() !== ""); } if (categoryMatch) { this.categories = categoryMatch[1].split(/,\s?/); } if (languageMatch) { this.prettyName = languageMatch[1]; } } static fromFile(filename) { return new Language( path.basename(filename).replace(".js", ""), filename ); } } async function compileLanguage(language, options) { const HEADER = `/*! \`${language.name}\` grammar compiled for Highlight.js ${packageJSON.version} */`; // TODO: cant we use the source we already have? const input = { ...build_config.rollup.browser_iife.input, input: language.path }; const output = { ...build_config.rollup.browser_iife.output, name: `hljsGrammar`, file: "out.js" }; output.footer = null; const data = await rollupCode(input, output); const iife = ` ${HEADER} (function(){ ${data} hljs.registerLanguage('${language.name}', hljsGrammar); })(); `.trim(); const esm = `${HEADER}\n${data};\nexport default hljsGrammar;`; language.module = iife; language.esm = esm; const miniESM = await Terser.minify(esm, options.terser); const miniIIFE = await Terser.minify(iife, options.terser); language.minified = miniIIFE.code; language.minifiedESM = miniESM.code; } async function getLanguages() { const languages = []; glob.sync("./src/languages/*.js").forEach((file) => { languages.push(Language.fromFile(file)); }); const extraPackages = await getThirdPartyPackages(); for (const ext of extraPackages) { for (const file of ext.files) { const l = Language.fromFile(file); l.loader = ext.loader; l.third_party = true; l.moduleDir = ext.dir; languages.push(l); } } return languages; } module.exports = { Language, getLanguages }; ================================================ FILE: tools/lib/makestuff.js ================================================ const fs = require("fs"); const CleanCSS = require('clean-css'); const path = require('path'); const _ = require('lodash'); const config = require("../build_config.js"); async function clean(directory) { const del = await import('del'); del.deleteSync([directory]); fs.mkdirSync(directory, { recursive: true }); } function install(file, dest = file) { fs.copyFileSync(file, `${process.env.BUILD_DIR}/${dest}`); } const DEFAULT_CSS = ` pre code.hljs { display: block; overflow-x: auto; padding: 1em; } code.hljs { padding: 3px 5px; } `.trim(); function installCleanCSS(file, dest, opts = {}) { // default is to minify // eslint-disable-next-line no-undefined const minify = opts.minify === undefined ? true : opts.minify; const theme = fs.readFileSync(file, { encoding: "utf8" }); const content = DEFAULT_CSS + "\n" + theme; const out = new CleanCSS(minify ? config.clean_css : config.clean_css_beautify).minify(content).styles; fs.writeFileSync(`${process.env.BUILD_DIR}/${dest}`, out); } function mkdir(dirname) { fs.mkdirSync(`${process.env.BUILD_DIR}/${dirname}`, { recursive: true }); } function renderTemplate(src, dest, data) { data.path = path; const content = fs.readFileSync(src, { encoding: "utf8" }); const rendered = _.template(content)(data); fs.writeFileSync(`${process.env.BUILD_DIR}/${dest}`, rendered); } module.exports = { clean, install, installCleanCSS, mkdir, renderTemplate }; ================================================ FILE: tools/perf.js ================================================ #!/usr/bin/env node const execSync = require('child_process').execSync; const fs = require('fs'); const { performance } = require('perf_hooks'); const build = () => { console.log(`Starting perf tests, building hljs ... `); // build node.js version of library with CJS and ESM libraries execSync('npm run build', { cwd: '.', env: Object.assign( process.env ) }); }; const timeTest = (name, func) => { process.stdout.write(` running ${name}...`); const t0 = performance.now(); func(); const t1 = performance.now(); console.log(` done! [${((t1 - t0) / 1000).toFixed(2)}s elapsed]`); }; const oneLanguageMarkupTests = (lang) => { for (let i = 0; i < 50; i++) { execSync('npx mocha ./test/markup', { cwd: '.', env: Object.assign( process.env, { ONLY_LANGUAGES: lang } ) }); } }; const oneLanguageCheckAutoDetect = (lang) => { for (let i = 0; i < 50; i++) { execSync('node ./tools/checkAutoDetect.js', { env: Object.assign( process.env, { ONLY_LANGUAGES: lang } ) }); } }; const globalCheckAutoDetect = () => { for (let i = 0; i < 5; i++) { execSync('node ./tools/checkAutoDetect.js'); } }; const highlightFile = (lang) => { const source = fs.readFileSync(`./tools/sample_files/${lang}.txt`, { encoding: 'utf8' }); const hljs = require('../build.js'); for (let i = 0; i < 2000; i++) { hljs.highlight(source, { language: lang }); } }; const main = (lang) => { build(); timeTest(`global checkAutoDetect`, globalCheckAutoDetect); timeTest(`${lang}-only markup tests`, () => oneLanguageMarkupTests(lang)); timeTest(`${lang}-only checkAutoDetect`, () => oneLanguageCheckAutoDetect(lang)); timeTest(`highlight large file`, () => highlightFile(lang)); }; main('python'); ================================================ FILE: tools/sample_files/python.txt ================================================ from pdb import set_trace import collections import re import sys import warnings from bs4.dammit import EntitySubstitution DEFAULT_OUTPUT_ENCODING = "utf-8" PY3K = (sys.version_info[0] > 2) whitespace_re = re.compile("\s+") def _alias(attr): """Alias one attribute name to another for backward compatibility""" @property def alias(self): return getattr(self, attr) @alias.setter def alias(self): return setattr(self, attr) return alias class NamespacedAttribute(unicode): def __new__(cls, prefix, name, namespace=None): if name is None: obj = unicode.__new__(cls, prefix) elif prefix is None: # Not really namespaced. obj = unicode.__new__(cls, name) else: obj = unicode.__new__(cls, prefix + ":" + name) obj.prefix = prefix obj.name = name obj.namespace = namespace return obj class AttributeValueWithCharsetSubstitution(unicode): """A stand-in object for a character encoding specified in HTML.""" class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution): """A generic stand-in for the value of a meta tag's 'charset' attribute. When Beautiful Soup parses the markup '', the value of the 'charset' attribute will be one of these objects. """ def __new__(cls, original_value): obj = unicode.__new__(cls, original_value) obj.original_value = original_value return obj def encode(self, encoding): return encoding class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution): """A generic stand-in for the value of a meta tag's 'content' attribute. When Beautiful Soup parses the markup: The value of the 'content' attribute will be one of these objects. """ CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M) def __new__(cls, original_value): match = cls.CHARSET_RE.search(original_value) if match is None: # No substitution necessary. return unicode.__new__(unicode, original_value) obj = unicode.__new__(cls, original_value) obj.original_value = original_value return obj def encode(self, encoding): def rewrite(match): return match.group(1) + encoding return self.CHARSET_RE.sub(rewrite, self.original_value) class HTMLAwareEntitySubstitution(EntitySubstitution): """Entity substitution rules that are aware of some HTML quirks. Specifically, the contents of ``` The full list of digests for every file can be found below. ### Digests ``` ``` ================================================ FILE: tsconfig.json ================================================ { "compilerOptions": { /* Basic Options */ "target": "es2016", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ "module": "es2015", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ "allowJs": true, /* Allow javascript files to be compiled. */ "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ "outDir": "./build", /* Redirect output structure to the directory. */ // "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "removeComments": true, /* Do not emit comments to output. */ // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ /* Strict Type-Checking Options */ "strict": false, /* Enable all strict type-checking options. */ "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ "strictNullChecks": false, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ /* Additional Checks */ "noUnusedLocals": true, /* Report errors on unused locals. */ "noUnusedParameters": true, /* Report errors on unused parameters. */ "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ /* Module Resolution Options */ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": ["./"], /* List of folders to include type definitions from. */ "types": [ "mocha", "./types/index" ], /* Type declaration files to be included in compilation. */ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ "resolveJsonModule": true, /* Source Map Options */ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ /* Experimental Options */ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */, }, "include": ["src/**/*", "tests/**/*"] } ================================================ FILE: types/index.d.ts ================================================ /* eslint-disable no-unused-vars */ /* eslint-disable no-use-before-define */ // For TS consumers who use Node and don't have dom in their tsconfig lib, import the necessary types here. /// declare module 'highlight.js/private' { import { CompiledMode, Mode, Language } from "highlight.js"; type MatchType = "begin" | "end" | "illegal" type EnhancedMatch = RegExpMatchArray & {rule: CompiledMode, type: MatchType} type AnnotatedError = Error & {mode?: Mode | Language, languageName?: string, badRule?: Mode} type KeywordData = [string, number]; type KeywordDict = Record } declare module 'highlight.js' { import { KeywordDict } from "highlight.js/private"; export type HLJSApi = PublicApi & ModesAPI export interface VuePlugin { install: (vue: any) => void } // perhaps make this an interface? type RegexEitherOptions = { capture?: boolean } interface PublicApi { highlight(code: string, options: HighlightOptions): HighlightResult /** @deprecated use `highlight(code, {language: ..., ignoreIllegals: ...})` */ highlight(languageName: string, code: string, ignoreIllegals?: boolean): HighlightResult highlightAuto: (code: string, languageSubset?: string[]) => AutoHighlightResult highlightBlock: (element: HTMLElement) => void highlightElement: (element: HTMLElement) => void configure: (options: Partial) => void initHighlighting: () => void initHighlightingOnLoad: () => void highlightAll: () => void registerLanguage: (languageName: string, language: LanguageFn) => void unregisterLanguage: (languageName: string) => void listLanguages: () => string[] registerAliases: (aliasList: string | string[], { languageName } : {languageName: string}) => void getLanguage: (languageName: string) => Language | undefined autoDetection: (languageName: string) => boolean inherit: (original: T, ...args: Record[]) => T addPlugin: (plugin: HLJSPlugin) => void removePlugin: (plugin: HLJSPlugin) => void debugMode: () => void safeMode: () => void versionString: string vuePlugin: () => VuePlugin regex: { concat: (...args: (RegExp | string)[]) => string, lookahead: (re: RegExp | string) => string, either: (...args: (RegExp | string)[] | [...(RegExp | string)[], RegexEitherOptions]) => string, optional: (re: RegExp | string) => string, anyNumberOfTimes: (re: RegExp | string) => string } newInstance: () => HLJSApi } interface ModesAPI { SHEBANG: (mode?: Partial & {binary?: string | RegExp}) => Mode BACKSLASH_ESCAPE: Mode QUOTE_STRING_MODE: Mode APOS_STRING_MODE: Mode PHRASAL_WORDS_MODE: Mode COMMENT: (begin: string | RegExp, end: string | RegExp, modeOpts?: Mode | {}) => Mode C_LINE_COMMENT_MODE: Mode C_BLOCK_COMMENT_MODE: Mode HASH_COMMENT_MODE: Mode NUMBER_MODE: Mode C_NUMBER_MODE: Mode BINARY_NUMBER_MODE: Mode REGEXP_MODE: Mode TITLE_MODE: Mode UNDERSCORE_TITLE_MODE: Mode METHOD_GUARD: Mode END_SAME_AS_BEGIN: (mode: Mode) => Mode // built in regex IDENT_RE: string UNDERSCORE_IDENT_RE: string MATCH_NOTHING_RE: string NUMBER_RE: string C_NUMBER_RE: string BINARY_NUMBER_RE: string RE_STARTERS_RE: string } export type LanguageFn = (hljs: HLJSApi) => Language export type CompilerExt = (mode: Mode, parent: Mode | Language | null) => void export interface HighlightResult { code?: string relevance : number value : string language? : string illegal : boolean errorRaised? : Error // * for auto-highlight secondBest? : Omit // private _illegalBy? : illegalData _emitter : Emitter _top? : Language | CompiledMode } export interface AutoHighlightResult extends HighlightResult {} export interface illegalData { message: string context: string index: number resultSoFar : string mode: CompiledMode } export type BeforeHighlightContext = { code: string, language: string, result?: HighlightResult } export type PluginEvent = keyof HLJSPlugin; export type HLJSPlugin = { 'after:highlight'?: (result: HighlightResult) => void, 'before:highlight'?: (context: BeforeHighlightContext) => void, 'after:highlightElement'?: (data: { el: Element, result: HighlightResult, text: string}) => void, 'before:highlightElement'?: (data: { el: Element, language: string}) => void, // TODO: Old API, remove with v12 'after:highlightBlock'?: (data: { block: Element, result: HighlightResult, text: string}) => void, 'before:highlightBlock'?: (data: { block: Element, language: string}) => void, } interface EmitterConstructor { new (opts: any): Emitter } export interface HighlightOptions { language: string ignoreIllegals?: boolean } export interface HLJSOptions { noHighlightRe: RegExp languageDetectRe: RegExp classPrefix: string cssSelector: string languages?: string[] __emitter: EmitterConstructor ignoreUnescapedHTML?: boolean throwUnescapedHTML?: boolean } export interface CallbackResponse { data: Record ignoreMatch: () => void isMatchIgnored: boolean } export type ModeCallback = (match: RegExpMatchArray, response: CallbackResponse) => void export type Language = LanguageDetail & Partial export interface Mode extends ModeCallbacks, ModeDetails {} export interface LanguageDetail { name?: string unicodeRegex?: boolean rawDefinition?: () => Language aliases?: string[] disableAutodetect?: boolean contains: (Mode)[] case_insensitive?: boolean keywords?: string | string[] | Record isCompiled?: boolean, exports?: any, classNameAliases?: Record compilerExtensions?: CompilerExt[] supersetOf?: string } // technically private, but exported for convenience as this has // been a pretty stable API and is quite useful export interface Emitter { startScope(name: string): void endScope(): void addText(text: string): void toHTML(): string finalize(): void __addSublanguage(emitter: Emitter, subLanguageName: string): void } export type HighlightedHTMLElement = HTMLElement & {result?: object, secondBest?: object, parentNode: HTMLElement} /* modes */ interface ModeCallbacks { "on:end"?: Function, "on:begin"?: ModeCallback } export interface CompiledLanguage extends LanguageDetail, CompiledMode { isCompiled: true contains: CompiledMode[] keywords: Record } export type CompiledScope = Record & {_emit?: Record, _multi?: boolean, _wrap?: string}; export type CompiledMode = Omit & { begin?: RegExp | string end?: RegExp | string scope?: string contains: CompiledMode[] keywords: KeywordDict data: Record terminatorEnd: string keywordPatternRe: RegExp beginRe: RegExp endRe: RegExp illegalRe: RegExp matcher: any isCompiled: true starts?: CompiledMode parent?: CompiledMode beginScope?: CompiledScope endScope?: CompiledScope } interface ModeDetails { begin?: RegExp | string | (RegExp | string)[] match?: RegExp | string | (RegExp | string)[] end?: RegExp | string | (RegExp | string)[] // deprecated in favor of `scope` className?: string scope?: string | Record beginScope?: string | Record endScope?: string | Record contains?: ("self" | Mode)[] endsParent?: boolean endsWithParent?: boolean endSameAsBegin?: boolean skip?: boolean excludeBegin?: boolean excludeEnd?: boolean returnBegin?: boolean returnEnd?: boolean __beforeBegin?: Function parent?: Mode starts?:Mode lexemes?: string | RegExp keywords?: string | string[] | Record beginKeywords?: string relevance?: number illegal?: string | RegExp | Array variants?: Mode[] cachedVariants?: Mode[] // parsed subLanguage?: string | string[] isCompiled?: boolean label?: string } const hljs : HLJSApi; export default hljs; } declare module 'highlight.js/lib/languages/*' { import { LanguageFn } from "highlight.js"; const defineLanguage: LanguageFn; export default defineLanguage; }