From 0a3ab815ea02c2365ec50fa0dce353c5fa2637f0 Mon Sep 17 00:00:00 2001 From: Antoine Grant Date: Mon, 26 Jun 2017 16:24:53 -0400 Subject: [PATCH 1/3] Correctly pass the options to marksy --- src/components/markdown.js | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/components/markdown.js b/src/components/markdown.js index 29d964f48..54af92104 100644 --- a/src/components/markdown.js +++ b/src/components/markdown.js @@ -32,23 +32,25 @@ 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, + } }); export default class Markdown extends Component { From d44a3f680a24d3ee1baa7b02de1a98aea6364e01 Mon Sep 17 00:00:00 2001 From: Antoine Grant Date: Mon, 26 Jun 2017 20:19:24 -0400 Subject: [PATCH 2/3] Added support for tables --- src/components/markdown.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/markdown.js b/src/components/markdown.js index 54af92104..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 }; @@ -50,6 +58,12 @@ const compile = marksy({ p: Text, strong: _S('bold'), ul: List, + table: Table, + thead: TableHeader, + th: TableHeaderItem, + tbody: TableBody, + tr: TableRow, + td: TableItem, } }); From 74c2af07739f6bd83e2f126a5b9198a8c2736fd9 Mon Sep 17 00:00:00 2001 From: Antoine Grant Date: Mon, 26 Jun 2017 20:26:54 -0400 Subject: [PATCH 3/3] Be more preecise on the markdown slide split characters --- src/components/markdown-slides.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }