diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 91d25dd..e74dc85 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This library tokenises code using Prism and provides a small render-props-driven component to quickly render it out into React. This is why it even works with React Native! It's bundled with a modified version of Prism that won't pollute the global namespace and comes with -[a couple of common language syntaxes](./src/vendor/prism/includeLangs.js). +[a couple of common language syntaxes](./packages/generate-prism-languages/index.ts#L9-L23). _(There's also an [escape-hatch](https://github.com/FormidableLabs/prism-react-renderer#prism) to use your own Prism setup, just in case)_ @@ -38,16 +38,17 @@ _(If you just want to use your Prism CSS-file themes, that's also no problem)_ + - [Installation](#installation) -- [Usage](#usage) -- [Custom Language Support](#custom-language-support) + - [Usage](#usage) + - [Custom Language Support](#custom-language-support) - [Basic Props](#basic-props) - [children](#children) - [language](#language) - [code](#code) - [Advanced Props](#advanced-props) - [theme](#theme) - - [Prism](#prism) + - [prism](#prism) - [Children Function](#children-function) - [state](#state) - [prop getters](#prop-getters) @@ -55,6 +56,7 @@ _(If you just want to use your Prism CSS-file themes, that's also no problem)_ - [`getTokenProps`](#gettokenprops) - [Theming](#theming) - [LICENSE](#license) +- [Maintenance Status](#maintenance-status) @@ -154,7 +156,7 @@ the section "[Children Function](#children-function)". > `string` | _required_ This is the language that your code will be highlighted as. You can see a list -of all languages that are supported out of the box [here](./src/vendor/prism/includeLangs.js). Not all languages are included and the list of languages that are currently is a little arbitrary. You can use the [escape-hatch](https://github.com/FormidableLabs/prism-react-renderer#prism) to use your own Prism setup, just in case, or [add more languages to the bundled Prism.](https://github.com/FormidableLabs/prism-react-renderer#faq) +of all languages that are supported out of the box [here](./packages/generate-prism-languages/index.ts#L9-L23). Not all languages are included and the list of languages that are currently is a little arbitrary. You can use the [escape-hatch](https://github.com/FormidableLabs/prism-react-renderer#prism) to use your own Prism setup, just in case, or [add more languages to the bundled Prism.](https://github.com/FormidableLabs/prism-react-renderer#faq) ### code diff --git a/packages/prism-react-renderer/CHANGELOG.md b/packages/prism-react-renderer/CHANGELOG.md index 4055b8c..373882d 100644 --- a/packages/prism-react-renderer/CHANGELOG.md +++ b/packages/prism-react-renderer/CHANGELOG.md @@ -1,5 +1,12 @@ # prism-react-renderer +## 2.0.5 + +### Patch Changes + +- Fixed bug where an undefined theme would cause a runtime error. + ([#213](https://github.com/FormidableLabs/prism-react-renderer/pull/213)) + ## 2.0.4 ### Patch Changes diff --git a/packages/prism-react-renderer/package.json b/packages/prism-react-renderer/package.json index 0d9c9cd..7f84d1e 100755 --- a/packages/prism-react-renderer/package.json +++ b/packages/prism-react-renderer/package.json @@ -1,6 +1,6 @@ { "name": "prism-react-renderer", - "version": "2.0.4", + "version": "2.0.5", "description": "Renders highlighted Prism output using React", "sideEffects": true, "main": "dist/index.js", diff --git a/packages/prism-react-renderer/src/index.ts b/packages/prism-react-renderer/src/index.ts index 16f4486..b1ef889 100644 --- a/packages/prism-react-renderer/src/index.ts +++ b/packages/prism-react-renderer/src/index.ts @@ -10,8 +10,10 @@ import { HighlightProps, PrismLib } from "./types" */ const Highlight = (props: HighlightProps) => createElement(InternalHighlight, { - prism: Prism as PrismLib, - theme: themes.vsDark, ...props, + prism: props.prism || (Prism as PrismLib), + theme: props.theme || themes.vsDark, + code: props.code, + language: props.language, }) export { Highlight, Prism, themes }