diff --git a/src/components/markdown-slides.js b/src/components/markdown-slides.js index 12e30331c..25a82f291 100644 --- a/src/components/markdown-slides.js +++ b/src/components/markdown-slides.js @@ -4,7 +4,7 @@ import Markdown from './markdown'; const transformStringsIntoJSX = function (strings) { return strings - .split('---') + .split(/\n---\n/) .map((markdown, index) => ( { markdown } diff --git a/src/components/markdown.js b/src/components/markdown.js index 29d964f48..e75fb582b 100644 --- a/src/components/markdown.js +++ b/src/components/markdown.js @@ -14,6 +14,14 @@ import Quote from './quote'; import S from './s'; import Text from './text'; +import Table from './table'; +import TableHeader from './table-header'; +import TableRow from './table-row'; +import TableHeaderItem from './table-header-item'; +import TableBody from './table-body'; +import TableItem from './table-item'; + + const _Heading = size => { const component = ({ children }) => {children}; component.propTypes = { children: PropTypes.node }; @@ -32,23 +40,31 @@ const _CombineBlockQuote = ({ children }) => ( _CombineBlockQuote.propTypes = { children: PropTypes.node }; const compile = marksy({ - a: Link, - blockquote: _CombineBlockQuote, - code: CodePane, - del: _S('strikethrough'), - em: _S('italic'), - h1: _Heading(1), - h2: _Heading(2), - h3: _Heading(3), - h4: _Heading(4), - h5: _Heading(5), - h6: _Heading(6), - img: Image, - codespan: Code, - li: ListItem, - p: Text, - strong: _S('bold'), - ul: List, + elements: { + a: Link, + blockquote: _CombineBlockQuote, + code: CodePane, + del: _S('strikethrough'), + em: _S('italic'), + h1: _Heading(1), + h2: _Heading(2), + h3: _Heading(3), + h4: _Heading(4), + h5: _Heading(5), + h6: _Heading(6), + img: Image, + codespan: Code, + li: ListItem, + p: Text, + strong: _S('bold'), + ul: List, + table: Table, + thead: TableHeader, + th: TableHeaderItem, + tbody: TableBody, + tr: TableRow, + td: TableItem, + } }); export default class Markdown extends Component {