From d1bcd3348c67cfbcd83178c9710cc54de9f776e8 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Thu, 9 Apr 2020 12:20:34 +0300
Subject: feat: consider 1-line html tag

---
 src/lib/Markdown/Content.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/lib/Markdown/Content.tsx')

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>;
-- 
cgit v1.2.3

