aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Markdown/Content.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-04-05 01:01:30 +0300
committereug-vs <eug-vs@keemail.me>2020-04-05 01:01:30 +0300
commita35cdfebf2d8c53c77900fee0826d4a967290e5d (patch)
tree1000c1408ae4d67e9a01ec2586deb3d34a968bc3 /src/lib/Markdown/Content.tsx
parent0dad2f90bc79bdaa909184c618da5c0473972e0c (diff)
downloadreact-benzin-a35cdfebf2d8c53c77900fee0826d4a967290e5d.tar.gz
feat: add Paragraph component
Diffstat (limited to 'src/lib/Markdown/Content.tsx')
-rw-r--r--src/lib/Markdown/Content.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Markdown/Content.tsx b/src/lib/Markdown/Content.tsx
index b7829ed..2a9e2ee 100644
--- a/src/lib/Markdown/Content.tsx
+++ b/src/lib/Markdown/Content.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import CodeBlock from './CodeBlock';
+import Paragraph from './Paragraph';
import { ParserPropTypes } from './types';
@@ -16,10 +17,10 @@ const Content: React.FC<ParserPropTypes> = ({ rawLines }) => {
let result;
if (denotesCodeBlock(line)) {
const closeIndex = rawLines.findIndex(line => denotesCodeBlock(line));
- const codeBlockLines = rawLines.splice(0, closeIndex);
+ const codeBlockLines = rawLines.splice(0, closeIndex + 1).slice(0, closeIndex);
result = <CodeBlock rawLines={codeBlockLines} />
} else {
- result = <p> {line} </p>
+ result = <Paragraph data={line} />
}
return (