Html2Markdown
Html2Markdown copied to clipboard
Line breaks kill italics
I have some HTML like this:
<i>Some text</br></i>
It's a strange way of doing it, but I have no control over the HTML. The problem is that this causes the converter to incorrectly render the markdown. It would be nice if elements in between the </i>
didn't break it.
@RareNCool that is not valid HTML
What would expect to happen?
@baynezy Sorry, I was typing from memory.
Here's the exact HTML:
<br></div><div>Whispering, <i>I love you, before long I die, <br></i></div><div>I have travell’d a long way merely to look on you to touch you,
from which I get (with HTML2Markdown):
The desired behavior would be for it to know that </i>
is closing italics and act accordingly, but I understand if that's too complicated to implement.
@RareNCool - what is wrong with that? Or rather what would you expect it to do? For accuracy maybe create a Gist of what you expect and then link to that here.
@TastesLikeTurkey - is this still a valid issue?
@baynezy Apologies, I forgot to ever respond. I think it still is, trying it at your demo page. For example, this:
<i>Hello there
I am Lord Foulspleen</i>
which is perfectly valid HTML, is converted to:
*Hello there
I am Lord Foulspleen*
which most Markdown renderers don't render correctly.
It would be nice if tags in the middle of other tags were handled correctly (adding a *
at the end of the first line and the beginning of the second). But I don't know how feasible this is. If it's not something you want to bother with I can always try to come up with my own solution, too.
Hopefully this example is clear:
<i>Hello,<br />I am Lord Foulspleen</i>
would become:
*Hello,*\n*I am Lord Foulspleen*
Blocked by #45