Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 5 additions & 5 deletions addons/info/src/components/Story.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import MTRC from 'markdown-to-react-components';
import marksy from 'marksy';
import PropTable from './PropTable';
import Node from './Node';
import { baseFonts } from './theme';
Expand Down Expand Up @@ -90,7 +90,7 @@ export default class Story extends React.Component {
open: false,
stylesheet: this.props.styles(JSON.parse(JSON.stringify(stylesheet))),
};
MTRC.configure(this.props.mtrcConf);
this.marksy = marksy(this.props.mtrcConf);
}

componentWillReceiveProps(nextProps) {
Expand Down Expand Up @@ -211,7 +211,7 @@ export default class Story extends React.Component {
const source = lines.map(s => s.slice(padding)).join('\n');
return (
<div style={this.state.stylesheet.infoContent}>
{MTRC(source).tree}
{this.marksy(source).tree}
</div>
);
}
Expand Down Expand Up @@ -340,12 +340,12 @@ Story.propTypes = {
showSource: PropTypes.bool,
styles: PropTypes.func.isRequired,
children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
mtrcConf: PropTypes.object,
marksyConf: PropTypes.object,
};

Story.defaultProps = {
showInline: false,
showHeader: true,
showSource: true,
mtrcConf: {},
marksyConf: {},
};
10 changes: 5 additions & 5 deletions addons/info/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const defaultOptions = {
propTables: [],
};

const defaultMtrcConf = {
const defaultMarksyConf = {
h1: H1,
h2: H2,
h3: H3,
Expand Down Expand Up @@ -48,9 +48,9 @@ export default {
options.propTables = null;
}

const mtrcConf = { ...defaultMtrcConf };
if (options && options.mtrcConf) {
Object.assign(mtrcConf, options.mtrcConf);
const marksyConf = { ...defaultMarksyConf };
if (options && options.marksyConf) {
Object.assign(marksyConf, options.marksyConf);
}

return this.add(storyName, context => {
Expand All @@ -63,7 +63,7 @@ export default {
propTables: options.propTables,
propTablesExclude: options.propTablesExclude,
styles: typeof options.styles === 'function' ? options.styles : s => s,
mtrcConf,
marksyConf,
};

return (
Expand Down