Skip to content

Commit

Permalink
Merge pull request #4 from NearSocial/fix-missing-prop
Browse files Browse the repository at this point in the history
Version 0.2.1
  • Loading branch information
Evgeny Kuzyakov authored Feb 25, 2023
2 parents 6579bfd + d320890 commit dde293e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

## 0.2.1

- Fixed `Markdown` component not rendering `code` sections when `syntaxHighlighterProps` is not passed.

## 0.2.0

- Added `syntaxHighlighterProps` props to `Markdown` component. This allows to pass props to the syntax highlighter component for `code` sections of the markdown. Allowed properties are `wrapLines`, `lineProps`, `showLineNumbers` and `lineNumberStyle`.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "near-social-vm",
"version": "0.2.0",
"version": "0.2.1",
"description": "Near Social VM",
"main": "dist/index.js",
"files": [
Expand Down
14 changes: 7 additions & 7 deletions src/lib/components/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ export const Markdown = (props) => {
),
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || "");
const {
wrapLines,
lineProps,
showLineNumbers,
lineNumberStyle
} = syntaxHighlighterProps;
const {
wrapLines,
lineProps,
showLineNumbers,
lineNumberStyle
} = syntaxHighlighterProps ?? {};

return !inline && match ? (
<SyntaxHighlighter
children={String(children).replace(/\n$/, "")}
Expand Down

0 comments on commit dde293e

Please sign in to comment.