aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Markdown/Section.tsx
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-04-09 16:42:12 +0300
committerGitHub <noreply@github.com>2020-04-09 16:42:12 +0300
commitad42e742c04c8302c2bcaf67c07ef215bba04f3b (patch)
treeda29af275ec03232d81938e77c36d894c7093c2f /src/lib/Markdown/Section.tsx
parentb808381b02097a25eb51b14246f7a239a785b347 (diff)
parentd1bcd3348c67cfbcd83178c9710cc54de9f776e8 (diff)
downloadreact-benzin-ad42e742c04c8302c2bcaf67c07ef215bba04f3b.tar.gz
Merge pull request #9 from eug-vs/md-improve
Markdown extensive features
Diffstat (limited to 'src/lib/Markdown/Section.tsx')
-rw-r--r--src/lib/Markdown/Section.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/Markdown/Section.tsx b/src/lib/Markdown/Section.tsx
index 5ce8954..1fcc46f 100644
--- a/src/lib/Markdown/Section.tsx
+++ b/src/lib/Markdown/Section.tsx
@@ -1,5 +1,6 @@
import React from 'react';
import ContentSection from '../ContentSection/ContentSection';
+import { Typography } from '@material-ui/core';
import Content from './Content';
import { ParserPropTypes } from './types';
@@ -30,7 +31,12 @@ const Section: React.FC<PropTypes> = ({ 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 <ChildrenSections rawLines={rawLines} level={getHeaderLevel(rawLines[0])}/>;
+ if (!level) return (
+ <>
+ <Typography> <Content rawLines={rawContent} /> </Typography>
+ <ChildrenSections rawLines={rawLines} level={getHeaderLevel(rawLines[0])}/>
+ </>
+ )
const sectionName = rawContent.splice(0, 1)[0].slice(level).trim();
const deeperLevel = getHeaderLevel(rawLines[0]);