diff options
author | eug-vs <eug-vs@keemail.me> | 2020-04-07 15:31:00 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-04-07 15:31:00 +0300 |
commit | 5c259810433be8cdbe6fcac8776cdbf4a0c244b0 (patch) | |
tree | 2f9e1ba87aba5740ed913457861c6f6c1f52d09c /src/lib/Markdown/Content.tsx | |
parent | 400330fe5ebd6951a97f07b6147b3af6113e034f (diff) | |
download | react-benzin-5c259810433be8cdbe6fcac8776cdbf4a0c244b0.tar.gz |
fix: account for \r line endings, remove consoles
Diffstat (limited to 'src/lib/Markdown/Content.tsx')
-rw-r--r-- | src/lib/Markdown/Content.tsx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/Markdown/Content.tsx b/src/lib/Markdown/Content.tsx index aaea100..30f2a8a 100644 --- a/src/lib/Markdown/Content.tsx +++ b/src/lib/Markdown/Content.tsx @@ -6,11 +6,10 @@ import { ParserPropTypes } from './types'; const denotesCodeBlock = (line: string): boolean => { - return line.match(/^```.*$/) !== null; -} + return line.match(/^\s*```.*$/) !== null; } const denotesDottedList = (line: string): boolean => { - return line.match(/^ ?- .*$/) !== null; + return line.match(/^ ?[-*] .*$/) !== null; } const denotesOpenHtml= (line: string): string => { @@ -53,7 +52,6 @@ const Content: React.FC<ParserPropTypes> = ({ rawLines }) => { } else if ((buffer = denotesSelfClosingHtml(line)) !== null) { const match = buffer[0]; const [before, after] = line.split(match); - console.log({ line, match, before, after}); buffer = ( <> <Text line={before} /> |