Skip to content

Releases: react-syntax-highlighter/react-syntax-highlighter

13.2.1

31 Jul 00:51
Compare
Choose a tag to compare

Minor bugfix: neglected to include rebuilt "Prism async light" demo files in 13.2.0 release

13.2.0

31 Jul 00:37
Compare
Choose a tag to compare
  • Updates our prism-themes dependency to pull in new themes, including vsc-dark-plus
  • Prism async demo now dynamically loads autogenerated Prism themes list (EDIT: neglected to include built demo files, fixed in 13.2.1)

New Prism themes available

  • a11yDark
  • dracula
  • materialDark
  • materialLight
  • materialOceanic
  • nord
  • shadesOfPurple
  • synthwave84
  • vscDarkPlus

13.1.1

30 Jul 15:45
132b6d5
Compare
Choose a tag to compare
  • Repaired demo builds for compatibility with Github Pages
  • Moved build-generated demo files to their own subdirectory inside /demo
  • updated repo URLs (we've migrated from conorhastings/react-syntax-highlighter to react-syntax-highlighter/react-syntax-highlighter)
  • corrected a link to the refractor repo

13.1.0

24 Jul 04:35
Compare
Choose a tag to compare

Updates to demos

  • indicate that Highlight powers the default demo
  • restored Prism demo that went missing in 13.0.0
  • autogenerate demo-specific style lists (and add a comment to autogenerated files pointing out that they're autogenerated)
  • demos now autoload full lists of languages and styles from highlight/prism
  • minor UI adjustments

13.0.0

23 Jul 22:42
Compare
Choose a tag to compare

Updates

  • latest highlight ^10.1.1 and lowlight ^1.14.0 dependencies
  • latest refractor ^3.0.0 and prism ^1.20.0 dependencies
  • updated/fixed tests
  • updated demos
  • CircleCi v2 config added

New API features

showInlineLineNumbers prop

<SyntaxHighlighter
  showLineNumbers={true} // required to show line numbers, whether inline or not
  showInlineLineNumbers={true} // render them inside wrapped lines, instead of as a separate <code> block
  renderer={virtualizedRenderer({
    rowHeight: 20
  })}
>
  {code}
</SyntaxHighlighter>

When paired with showLineNumbers={true}, showInlineLineNumbers={true} injects line numbers into each wrapped line of code, instead of creating a separate <code></code> block for the numbers. This allows line numbering to work with virtualized renderers such as react-syntax-highlighter-virtualized-renderer.

Inline line numbers are styled so that they're not selected when drag-selecting multiple lines of highlighted text, preserving expected behavior.

Breaking changes

  • If you rely on the darkula theme from highlight.js, highlight v10 has renamed that style to darcula.

Highlight v10 introduced some breaking changes for us here which we've worked around, but shouldn't cause breakage for most people relying on react-syntax-highlighter and not consuming highlight.js directly.

Supported languages

Note: react-syntax-highlighter provides an automated build wrapper around styles and languages provided by highlight.js (via lowlight) and prism (via refractor). Changes here are simply describing what's changed in those libraries. If you'd like to see another language or style added, please contribute to those libraries.

New highlight.js languages

  • cLike (c-like)
  • c
  • latex
  • phpTemplate (php-template)
  • pythonRepl (python-repl)

Renamed/removed highlight.js languages

  • cs (renamed to csharp)
  • nimrod (renamed to nim)
  • tex (removed)

New prism.js languages

  • antlr4
  • aql
  • bbcode
  • brightscript
  • concurnas
  • dax
  • etlua
  • excelFormula (excel-formula)
  • factor
  • firestoreSecurityRules (firestore-security-rules)
  • ftl
  • gdscript
  • latte
  • llvm
  • moonscript
  • neon
  • powerquery
  • qml
  • robotframework
  • solidity
  • solutionFile (solution-file)
  • sparql
  • sqf
  • turtle
  • zig