Skip to content

Commit

Permalink
fix #349
Browse files Browse the repository at this point in the history
  • Loading branch information
viwer authored and conorhastings committed Nov 14, 2021
1 parent 3d9b4ac commit a07d67e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default function(defaultAstGenerator, defaultStyle) {
renderer,
PreTag = 'pre',
CodeTag = 'code',
code = Array.isArray(children) ? children[0] : children,
code = (Array.isArray(children) ? children[0] : children) || '',
astGenerator,
...rest
}) {
Expand Down

1 comment on commit a07d67e

@miamorekun
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! It does not work, unfortunately. I try to pass JSX elements generated by slate.js, but i had an Error:

js highlight.js:16 Uncaught (in promise) TypeError: str.match is not a function at getNewLines (highlight.js:16:1) at _loop (highlight.js:187:1) at processLines (highlight.js:243:1) at SyntaxHighlighter (highlight.js:412:1) at renderWithHooks (react-dom.development.js:14985:1) at mountIndeterminateComponent (react-dom.development.js:17811:1) at beginWork (react-dom.development.js:19049:1) at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1) at invokeGuardedCallback (react-dom.development.js:4056:1)

Снимок экрана 2022-04-12 в 19 50 28

Please sign in to comment.