- All highlighters except for the old "-light" vareities, now have a supportedLanguges 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 a esm & cjs output, 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.
- Async loaded versions of prism & highlight
- properly propagate className argument to createLineElement when wrapLines=true
- pass along classNames that are not part of stylesheet (this allows passing in className in lineProps)
- 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