- Fixed
highlight
version regression
- Updated
lowlight
to 1.17.0 to matchhighlight
dependency version
- Bugfix: increased minwidth to avoid unequal line number widths
- Bugfix: prevent last line of file from rendering an unwanted line number
- Security fix: updated highlight.js to 10.4.1
- Bugfix: styling correctly applied to interpolation punctuation
- Updated prismjs (1.22.0) and refractor (3.2.0)
- Updated prism-themes (1.5.0)
- Fixed a broken readme link
- Bugfix: use string templating in language-specific theming code
- Allow language-specific theme styles to override default theme styles
- Updated to
prism-themes
1.4.1
- Regenerate Prism themes containing nested tokens
- Breaking change: Allow styling nested tokens with classes in styles (probably not practically breaking for most, since this is a change that fixes a previously non-working feature)
- updated test snapshots after 14.0.1 fix
- added tests for line number rendering behavior
- Bugfix: Show line numbers only when
showLineNumbers == true
- New prop:
wrapLongLines
, which removes the need to manually addwhite-space: pre
styling - New default prop value:
showInlineLineNumbers = true
: whenshowLineNumbers
istrue
, we now default to inline line numbers instead of putting them in a separate<code>
block - Explicit white-space styling on
<code>
tag (will be set to eitherwhite-space: pre
orwhite-space: pre-wrap
depending on value ofwrapLongLines
prop)
- don't forget to add current version to CHANGELOG at release time :)
- filled in CHANGELOG for v10.x through v13.5.1
- Brought back
createElement
that went missing as of version 13.5.
import createElement from "react-syntax-highlighter/create-element";
- Cleaned up old files in project root, add jest to eslint
- Updated to
refractor
3.1.0, which brings inprismjs
1.21.0. We'd pinnedreact-syntax-highlighter 13.3.1
toprismjs 1.21.0
, but didn't realize thatrefractor
's dependency would keep us at 1.20.0
- added ESLint (react-syntax-highlighter#298)
- added favicon to demo (react-syntax-highlighter#295)
- new addition to the "built with" list (react-syntax-highlighter#293)
- JS error when using lineNumberStyle() for inline line numbers
- incorrect 'hljs' className applied to
<pre>
when using Prism
prism
updated to 1.21.0, with lots of improvements: CHANGELOG for prism 1.21.0- added Github repo link to the upper right corner of demo pages
- Truncated Prism
shell-session
language command output - Incorrect syntax highlighting for mutli-line comments
- Unexpected behavior with
useInlineStyles={false}
- Neglected to include rebuilt "Prism async light" demo files in 13.2.0 release
- Updated 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)
a11yDark
dracula
materialDark
materialLight
materialOceanic
nord
shadesOfPurple
synthwave84
vscDarkPlus
- 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
Demo updates:
- 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
- latest
highlight ^10.1.1
andlowlight ^1.14.0
dependencies - latest
refractor ^3.0.0
andprism ^1.20.0
dependencies - updated codecov and lodash deps
- corrected .gitignore
- updated/fixed tests
- new Demos UI
- CircleCi v2 config added
- exposed
createElement()
in public API - change FUNDING platform from
liberapay
togithub
- added projects to "built with" section of README
- updated
websocket-extensions
to 0.1.4
<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.
Highlight v10 introduced some breaking changes for us here which we've worked around (mainly that getLanguage
was no longer exposed), but this shouldn't cause breakage for most people relying on react-syntax-highlighter
and not consuming highlight.js
directly.
- If you rely on the
darkula
theme fromhighlight.js
, highlight v10 has renamed that style todarcula
.
cs
(renamed tocsharp
)nimrod
(renamed tonim
)tex
(removed)
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.
cLike
(c-like
)c
latex
phpTemplate
(php-template
)pythonRepl
(python-repl
)
abnf
antlr4
aql
bbcode
bnf
brightscript
cil
cmake
concurnas
dax
dnsZoneFile
(dns-zone-file
)ebnf
ejs
etlua
excelFormula
(excel-formula
)factor
firestoreSecurityRules
(firestore-security-rules
)ftl
gcode
gdscript
gml
hcl
javadoc
javadoclike
javastacktrace
jq
jsExtras
(js-extras
)jsTemplates
(js-templates
)jsdoc
json5
jsonp
latte
lilypond
llvm
moonscript
n1ql
nand2tetrisHdl
(nand2tetris-hdl
)neon
pascaligo
pcaxis
phpdoc
powerquery
qml
regex
robotframework
shellSession
(shell-session
)solidity
solutionFile
(solution-file
)sparql
splunkSpl
(splunk-spl
)sqf
t4Cs
(t4-cs
)t4Templating
(t4-templating
)t4Vb
(t4-vb
)toml
turtle
vala
zig
- version bump, no other changes
- version bump, no other changes
- added projects to README
- updated Docker config: removed
/sbin/init
command - introduced Github Actions config
- removed CircleCI config
- updated
mixin-deep
andhandlebars
dependencies - updated "removed" code in diff demo
- updated
style
prop description in README - updated demo URL from
conor.rodeo
toconorhastings.github.io
- updated
lodash
dep from 4.17.11 to 4.17.14
- version bump, no other changes
- version bump, no other changes
- build to update
async-languages
for highlight, picking up new languages added in 10.3.0
Historical note:
vs-dark
theme was automatically removed fromAVAILABLE_STYLES_PRISM.MD
in build process here
- version bump
- minor code change to diff demo
- added FUNDING.yml
- minor README updates
- added projects to "built with" section of README
- corrected README typos
angelscript
arcade
gml
isbl
pgsql
plaintext
properties
reasonml
sas
xonokai
vs-dark
- fixed
classNames
concatenation increateElement
- updated test snapshots accordingly
- updated license copyright date
- updated
highlight
from 9.12.0 to 9.13.0 - updated
lowlight
from 1.9.1 to 1.11.0
a11yDark
a11yLight
anOldHope
atomOneDarkReasonable
gml
isblEditorDark
isblEditorLight
lightfair
nord
shadesOfPurple
- README corrections
- updated deps:
@babel/runtime
,babel-jest
,codecov
,jest
,request
,webpack-dev-server
- updated import paths in demos
- fine-tuned
prettier
config - prettier cleanup of src and demo code
- use
@babel/runtime
instead ofbabel-runtime
- All highlighters except for the old "-light" varieties now have a
supportedLanguages
field which can be used to determine the supported languages
registerLanguage
is now a static method of the default export of highlighters that require registering of languages.prism-async-light
&light-async
now ship with their own language loaders- Added
esm
&cjs
outputs. Importing should now be done through import OR the import should point into the dist directory.
import SyntaxHighlighter from "react-syntax-highlighter/prism";
// Becomes:
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
// OR (less ideally)
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter/dist/cjs/prism";
// OR
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter/dist/esm/prism";
- styles have moved into the
dist
directory. Update your imports from:
import style from 'react-syntax-highlighter/styles/prism'
to:
import style from 'react-syntax-highlighter/dist/styles/prism'
- fixed code-splitting in webpack 3.
- Added async loaded versions of prism & highlight
- properly propagate
className
argument tocreateLineElement
whenwrapLines=true
- pass along classNames that are not part of stylesheet (this allows passing in
className
inlineProps
)
- update
refractor
version
- updated
.npmignore
to make it include less unneccsary files. - update example in README to show proper path for require styles
- handle fs errors in language and stylesheet build scripts
- fix link to
refractor
in README
- removed claims of sanity from README
- add lineProps prop which takes either an object or a function that returns an object that is then passed onto each line created when wrapLines=true
- removed lineStyle prop the behavior of this prop can be replicated with lineProps passing a style object inside the props object. this is a breaking change
- add
.babelrc
to.npmignore
for parcel support
- move
prism-themes
to dev dependencies
- added light version support for prism (refractor) based highlighting
- fixed vendor prefixing for prism styles
- add links to available languages in README (by @adamweeks)
- fix line number display for prism highlighter
- fix git links in package.json
- update package main to be root instead of dist
- add support for alternative syntax highlighting using ast generated from prismjs via refractor (by @conorhastings and @maxmcd)
- avoid unneeded function calls if language is text
- note text language in readme
- avoid unneeded function calls if language is text
- note text language in readme
- add support for text as valid language
- check if children is array and use children[0] if so.
- check if we have language before attempting to highlight.
- add test for unknown language to avoid further issues with content not rendering
- added code of conduct
- update dependency versions
- fix edge cases in line wrapping feature
- add list of available languages (by @forresto)
- render plain string if no language present
- add license file
- update readme
- added test for useInlineStyles=false
- export previously unexported functions from createElemeent
- add code coverage
- add code coverage
- flatten tree before using wrapLines function
- allow using a custom renderer without wrapLines
- flatten tree before using wrapLines function
- allow using a custom renderer without wrapLines
- update broken links in demo
- handle some edge cases in wrapLines function
- generalize function for finding text child
- update version of react-syntax-highlighter-virtualized-renderer for demo
- handle some edge cases in wrapLines function
- add api to allow for use of custom renderer (virtualized, native, etc...)
- add api to allow for use of custom renderer (virtualized, native, etc...)
- allow wrapping of individual element in tag
- allow styling individual numbers
- add support for IE and older android browsers (by @yahiousun)
- update dependencies
- wrap individual line numbers in span
- removed envified light build in favor of only using seperate entry point
- export lowlight registerLanguage in light build
- add section to readme showcasing projects built with react syntax highlighter
- fix style assignment function to not end up with unexpected styles
- call highlightAuto if no language provided
- unify quote style in code
- add support for line numbers
- fix require of default style
- add jest snapshot testing
- add more available styles
- add new info on light build to readme
- don't wrap text in spans
- add a seperate entry point for light build (by @bmathews)
- add codeTagProps to props to allow passing arbitrary orios to code tag
- allow optionally applying css classNames instead of inline styles
- fix light build example
- add customStyle prop
- update available styles
- allow light build via env variable
- fix warning by not passing invalid non dom props to pre tag
- update depedndencies
- strict dependency on highlight
- update dependency and add new styles
- fix bad import in readme
- fix missing quotes around import location in readme example
- have user pass in style object instead of string of style name
- make peerDependency of react more liberal
- code style changes
- add new highlight.js styles
- remove unused createTextElement function
- use a Text component instead of createTextElement function
- explain js styles in readme
- use default top level style from highightjs
- fix spelling of segment in code (by @winkler1)
- update package to allow any version of react 14
- wrap children in code element as well as pre element
- add script to build javascript styles
- write readme
- allow changing style in demo
- add script to build javascript styles
- write readme
- update lowlight version
- use pre not span
- pass along optional props to pre tag
- initial version
- syntax highlighting using virtual dom created by lowlight