Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ Markdown generated tags aren't prop configurable, and instead render with your t
|Name|PropType|Description|
|---|---|---|
|source|PropTypes.string| Markdown source |
|mdastConfig| PropTypes.object | Mdast configuration object |

<a name="element-tags"></a>
### Element Tags
Expand Down
6 changes: 0 additions & 6 deletions src/components/__snapshots__/markdown-slides.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exports[`MarkdownSlides should render correctly when using function syntax 1`] =
>

## Slide A Title

</Markdown>
</Slide>
<Slide
Expand All @@ -25,7 +24,6 @@ exports[`MarkdownSlides should render correctly when using function syntax 1`] =
<Markdown
style={Object {}}
>

## Slide B Title

</Markdown>
Expand All @@ -45,7 +43,6 @@ exports[`MarkdownSlides should render correctly when using tagged template liter
style={Object {}}
>
## Slide 1 Title

</Markdown>
</Slide>
<Slide
Expand All @@ -57,7 +54,6 @@ exports[`MarkdownSlides should render correctly when using tagged template liter
<Markdown
style={Object {}}
>

## Slide 2 Title
</Markdown>
</Slide>
Expand All @@ -77,7 +73,6 @@ exports[`MarkdownSlides should render correctly when using tagged template liter
>
## Slide 1 Title
This text is **bold**.

</Markdown>
</Slide>
<Slide
Expand All @@ -89,7 +84,6 @@ exports[`MarkdownSlides should render correctly when using tagged template liter
<Markdown
style={Object {}}
>

## Slide 2 Title
</Markdown>
</Slide>
Expand Down
12 changes: 10 additions & 2 deletions src/components/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,23 @@ const compile = marksy({
export default class Markdown extends Component {
static propTypes = {
children: PropTypes.node,
style: PropTypes.object,
source: PropTypes.string,
style: PropTypes.object
};

static defaultProps = {
style: {},
};

render() {
const { style, children } = this.props;
const { style, children, source } = this.props;
if (source) {
return (
<div style={style}>
{compile(source).tree}
</div>
);
}
return (
<div style={style}>
{compile(children).tree}
Expand Down