aaronsw / html2text

Convert HTML to Markdown-formatted text.
http://www.aaronsw.com/2002/html2text/
GNU General Public License v3.0
2.58k stars 410 forks source link

Bold and italics within code blocks aren't recognized #57

Open fmarier opened 11 years ago

fmarier commented 11 years ago

Pass them through as raw HTML instead.

aaronsw commented 11 years ago

What's the use case for this? I'm having trouble understanding why you'd want this result.

fmarier commented 11 years ago

That patch (and the other ones) comes from my Blogger-to-Ikiwiki conversion script.

On my blog, I've got code samples where I highlight particular pieces by making them bold or italics.

aaronsw commented 11 years ago

Yeah, but in standard Markdown indented HTML tags get escaped. So this doesn't seem like it would help. Is this not true with ikiwiki?

fmarier commented 11 years ago

Hm, you're right. I just tried it with the normal markdown cli tool and the above test case produces this mess:

<p>This is a <b>bold</b> statement.</p>

<pre><code>This is a &lt;i&gt;foreign&lt;/i&gt; word.
</code></pre>

which isn't even consistent.

In the ikiwiki parser, it lets these tags through. In fact I have more hacks that take advantage of that.