Skip to content

v2.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 14 Aug 13:26
· 1 commit to main since this release

2.0.0 (2026-08-14)

  • feat!: fold the display mode into the options as block (22a5b7d)
  • feat!: make line numbers opt-in (e054eaa)
  • feat!: remove loadLanguage (776f0d3)
  • feat!: remove printHighlight and deprecate loadLanguage (fd4459b)
  • feat!: remove the common.js export (3295380)
  • feat!: remove the oneline display mode (62b1e87)
  • feat!: rename highlightText to highlightHTML and highlightANSI (702d0dd)
  • feat!: rename tokenizeSync to tokenizeWith (ea6a6eb)
  • feat!: replace setTheme with a theme argument (71b4fe8)
  • feat!: require the theme argument of highlightANSI (ac460af)

Bug Fixes

  • bash: drop $< from the keyword pattern (2a4891a)
  • build: stop inlining the language and theme files (4ca78b7)
  • detect: improve the scoring heuristic (e5ec9c3)
  • diff: stop - being read as a range (a39a95f)
  • inline the language list in the deno example (a2b34ce)
  • keep the type of a rule whose sub is not given (a994393)
  • resume on the failed match instead of re-emitting the source (2f30bca)

Features

  • add the playground (c7bb24d)
  • expose registry-free tokenize function (f56d062)
  • go: support := (39c104f)
  • let a language override its Detection cell with @detect (8bf186d)
  • playground: add the Bearded Icons set (5f6c3ff)
  • theme: size default.css in em (4dec0c8)

BREAKING CHANGES

  • showLineNumbers defaults to false, pass { showLineNumbers: true } for the gutter v1 rendered by default.
  • highlightElement(elm, lang, mode, opt) is now highlightElement(elm, lang, opt) with the mode passed as opt.block, highlightHTML's opt.multiline is renamed to opt.block, and the emitted class changes from shj-multiline to shj-block.
  • the oneline mode and the shj-oneline class are gone, a div is always a block.
  • tokenizeSync is now tokenizeWith.
  • highlightANSI no longer defaults its theme, pass one from themes/*.js.
  • loadLanguage is gone, use setLoader or pass the grammar directly as lang.
  • highlightText is gone, use highlightHTML for markup or highlightANSI for a terminal.
  • printHighlight is gone, use highlightANSI.
  • setTheme is gone, pass the theme to highlightANSI instead.
  • the common.js entry is gone, its shared patterns are built into the tokenizer as { expand: 'num' | 'str' | 'strDouble' }.