Releases: react-syntax-highlighter/react-syntax-highlighter
13.2.1
13.2.0
- Updates our
prism-themes
dependency to pull in new themes, includingvsc-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
- 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
toreact-syntax-highlighter/react-syntax-highlighter
) - corrected a link to the
refractor
repo
13.1.0
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
Updates
- latest
highlight ^10.1.1
andlowlight ^1.14.0
dependencies - latest
refractor ^3.0.0
andprism ^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 fromhighlight.js
, highlight v10 has renamed that style todarcula
.
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 byhighlight.js
(vialowlight
) andprism
(viarefractor
). 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 tocsharp
)nimrod
(renamed tonim
)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