logoalt Hacker News

akshayshahlast Friday at 9:27 PM2 repliesview on HN

I like Markdown, and generally agree that it strikes a nice balance between correctness and usability...

...but it's delicious that this blog post also demonstrates an ambiguity in Markdown: how to handle intra-word emphasis. In the rendered output, "mark_up_" and "mark_down_" were probably intended to be "mark<em>up</em>" and "mark<em>down</em>", but the underscores were instead rendered literally.

I do appreciate that Markdown's solution to ambiguities like this is dead simple - just inline some HTML.


Replies

anildashyesterday at 12:59 AM

I actually _did_ want the underscores, but enough people thought it wasn't intentional that I just gave up and changed it to italics. lol?

show 1 reply
AlienRobotlast Friday at 9:39 PM

I think it's delicious how nobody, absolutely nobody, wants _ to mean "emphasis," they want italics, and yet despite there being a markdown-to-HTML build step nobody has ever done what they were told they were supposed to do to circumvent the semantic issue and use <span class="italic"> instead of <em>.

It wouldn't even make sense for markdown if it were language-agnostic to output <em> when that's HTML-only.

I'm going to go to my grave repeating that <em> is just <i> version 2.

show 2 replies