diff options
author | eug-vs <eug-vs@keemail.me> | 2020-04-09 12:20:34 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-04-09 12:20:34 +0300 |
commit | d1bcd3348c67cfbcd83178c9710cc54de9f776e8 (patch) | |
tree | c8edad22d2d79b7a155b2783fef8a6f4c2eae6a7 | |
parent | 6d36ca60373f4d89d79209d0c6324d6eda5a001d (diff) | |
download | react-benzin-md-improve.tar.gz |
feat: consider 1-line html tagmd-improve
-rw-r--r-- | src/lib/Markdown/Content.tsx | 2 |
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>; |