From 5c259810433be8cdbe6fcac8776cdbf4a0c244b0 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 7 Apr 2020 15:31:00 +0300 Subject: fix: account for \r line endings, remove consoles --- src/lib/Markdown/Content.tsx | 6 ++---- src/lib/Markdown/Markdown.tsx | 2 +- src/lib/Markdown/SyntacticSpan.tsx | 1 - 3 files changed, 3 insertions(+), 6 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 = ({ rawLines }) => { } else if ((buffer = denotesSelfClosingHtml(line)) !== null) { const match = buffer[0]; const [before, after] = line.split(match); - console.log({ line, match, before, after}); buffer = ( <> diff --git a/src/lib/Markdown/Markdown.tsx b/src/lib/Markdown/Markdown.tsx index 09ad54a..0a71fd3 100644 --- a/src/lib/Markdown/Markdown.tsx +++ b/src/lib/Markdown/Markdown.tsx @@ -16,7 +16,7 @@ const Markdown: React.FC = ({ data, url }) => { }, [data, url]); if (url) axios.get(url).then(response => setMarkdown(response.data)); - return
+ return
}; diff --git a/src/lib/Markdown/SyntacticSpan.tsx b/src/lib/Markdown/SyntacticSpan.tsx index 299bf87..7fd9bc5 100644 --- a/src/lib/Markdown/SyntacticSpan.tsx +++ b/src/lib/Markdown/SyntacticSpan.tsx @@ -42,7 +42,6 @@ const splitter = new RegExp(Object.values(regex).map(pair => pair.global.source) const emojiList: Emoji[] = []; Object.keys(emojiLib).forEach(name => emojiList.push({ name, char: emojiLib[name].char })); -console.log({emojiList}) const useStyles = makeStyles(theme => ({ code: { -- cgit v1.2.3