From 46f410699037824408daf7c035458ba7bd958d44 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 7 Apr 2020 20:32:10 +0300 Subject: feat: include content before first header --- src/lib/Markdown/Section.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/Markdown/Section.tsx b/src/lib/Markdown/Section.tsx index 5ce8954..987b771 100644 --- a/src/lib/Markdown/Section.tsx +++ b/src/lib/Markdown/Section.tsx @@ -30,7 +30,12 @@ const Section: React.FC = ({ rawLines, level = 0 }) => { const deeperLevelIndex = rawLines.findIndex(line => line.match(`^#{${level + 1},} .*$`)); const rawContent = rawLines.splice(0, (deeperLevelIndex < 0) ? rawLines.length : deeperLevelIndex); - if (!level) return ; + if (!level) return ( + <> + + + + ) const sectionName = rawContent.splice(0, 1)[0].slice(level).trim(); const deeperLevel = getHeaderLevel(rawLines[0]); -- cgit v1.2.3