aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-04-09 12:20:34 +0300
committereug-vs <eug-vs@keemail.me>2020-04-09 12:20:34 +0300
commitd1bcd3348c67cfbcd83178c9710cc54de9f776e8 (patch)
treec8edad22d2d79b7a155b2783fef8a6f4c2eae6a7
parent6d36ca60373f4d89d79209d0c6324d6eda5a001d (diff)
downloadreact-benzin-md-improve.tar.gz
feat: consider 1-line html tagmd-improve
-rw-r--r--src/lib/Markdown/Content.tsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/Markdown/Content.tsx b/src/lib/Markdown/Content.tsx
index 5895df9..5816214 100644
--- a/src/lib/Markdown/Content.tsx
+++ b/src/lib/Markdown/Content.tsx
@@ -49,7 +49,7 @@ const Content: React.FC<ParserPropTypes> = ({ rawLines }) => {
buffer = <ul>{dottedListLines.map(li => <li><Text line={li.slice(2)} /></li>)}</ul>;
} else if ((buffer = denotesOpenHtml(line))) {
const tag = buffer;
- const closeIndex = rawLines.findIndex(line => denotesClosingHtml(line, tag));
+ const closeIndex = denotesClosingHtml(line, tag) ? -1 : rawLines.findIndex(line => denotesClosingHtml(line, tag));
const htmlLines = rawLines.splice(0, closeIndex + 1);
htmlLines.unshift(line);
buffer = <div dangerouslySetInnerHTML={{ __html: htmlLines.join('\n') }}></div>;