Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've never heard markdown referred to as unnecessarily complex before. Genuinely curious, what features / complexity would you strip out?


I’d prefer everything to have the same syntax, like in HTML (or I should better say XML).

When every feature has different syntax, like in Markdown, it makes parsers much larger and leads to an extreme amount of edge cases that every parser has to handle. For example, when you see an asterisk, you have to decide whether it denotes italics, bold or a bulleted list, which might not be trivial.

Generating correct Markdown from a different is also much harder. In HTML, you just need to escape all your less-than signs, ampersands and quotes. In Markdown, you need to check whether your content is going to trigger various edge cases and deal with them accordingly.


Markdown's complexities reside almost entirely within its syntax, sure. There would have to be some kind of formal grammar, or a very, very deep suite of test cases. Without a formal grammar, you introduce risk through ambiguity. But, Markdown's scope is relatively limited, so that risk is unlikely to result in catastrophic failures (as long as you disregard that whole "embedded HTML" thing).

generating Markdown is tricky, but that's fine. In this scenario, Markdown would be hand-written and machine-read. There are plenty of use cases where Markdown wouldn't (and shouldn't) replace HTML, and "computer-generated web pages" is one of those use cases.

I think the biggest hitch would be metadata. A lot of Markdown parsers have support for a YAML header, but that behavior is heavily implementation-dependent (even relative to other markdown features). Coming to a consensus on this could get ugly.


Yeah, I guess that's a really good point. I've never thought much about it before, but you're right that the simplicity of markdown is probably more from the point of view of the human writer/reader, and is really just passing the complexity down to the parser.


You don't need to escape all your ampersands and quotes. An ampersand that doesn't form an html entity will render as is, quotes are perfectly fine unless used in an HTML attribute. And in an html attribute, less thans are fine. The body of a script tag has different parsing rules.


You don’t need to escape them, but it certainly doesn’t hurt. And script tags are generally not a problem when building something from a template, but they are a reason why XML is more “pure” than HTML.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: