You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering an issue where two newlines (i.e. markdown paragraphs) are inserted after <span> elements. The same happens if it is a <div> or a made-up <pqr> tag.
Here's a very simple test case:
constshowdown=require('showdown');constconverter=newshowdown.Converter();constsampleText='<p>A test <span>case</span> to see if I can <span>reproduce</span> the extra newline <span>problem</span>.</p>';constret=converter.makeMarkdown(sampleText);console.log(ret);
Where I'd expect the result to be: A test <span>case</span> to see if I can <span>reproduce</span>the extra newline <span>problem</span>.\n\n
I get: A test <span>case</span>\n\n to see if I can <span>reproduce</span>\n\n the extra newline <span>problem</span>\n\n.
I don't expect this is the desired behavior... Is there an option I'm missing that would solve this problem? Or is it a bug?
UPDATE:
I seem to have fixed the problem for myself by overriding showdown.makeMarkdown.node, where rather than
default:
txt=node.outerHTML+'\n\n';break;
I have:
default:
txt=node.outerHTML;break;}
The text was updated successfully, but these errors were encountered:
I'm encountering an issue where two newlines (i.e. markdown paragraphs) are inserted after
<span>
elements. The same happens if it is a<div>
or a made-up<pqr>
tag.Here's a very simple test case:
Where I'd expect the result to be:
A test <span>case</span> to see if I can <span>reproduce</span>the extra newline <span>problem</span>.\n\n
I get:
A test <span>case</span>\n\n to see if I can <span>reproduce</span>\n\n the extra newline <span>problem</span>\n\n.
I don't expect this is the desired behavior... Is there an option I'm missing that would solve this problem? Or is it a bug?
UPDATE:
I seem to have fixed the problem for myself by overriding
showdown.makeMarkdown.node
, where rather thanI have:
The text was updated successfully, but these errors were encountered: