4 ms·
As the essay and this discussion repeatedly try to emphasize, thinking of Markdown as a "superset of HTML" is missing the point - it is meant to be read. It has
by Shog9 2y ago
As the essay and this discussion repeatedly try to emphasize, thinking of Markdown as a "superset of HTML" is missing the point - it is meant to be read. It has both meaningful and collapsible whitespace, and both allows and encourages uses of whitespace that only have a significant effect on source readability.
...Arguably, the reason HTML has collapsible whitespace is to allow writing readable source, and once upon a time it was more common to see HTML produced in a way that didn't get in the way of this (e.g. paragraphs and indentation indicated primarily via whitespace with only opening `<p>` and `<li>` tags). But that ship sailed; tooling long ago coalesced around more rigid conventions, and thus the need for Markdown emerged. Throwing those advantages away raises the question of why bother using Markdown at all.
- The_Colonel 2y agoBack in 2004, Gruber introduced Markdown with this: > I’ve written a text-to-HTML formatting tool called Markdown ... which kinda suggests to me it's meant to be rendered. Markdown's major advantage is that it's (mostly) readable as plaintext (essentially a graceful degradation), but evidenced by how most tools using it render Markdown into HTML instead of showing it unrendered, it doesn't seem like people prefer reading it.
- fenomas 2y agoNobody suggested markdown isn't meant to be rendered to HTML - that's not in doubt, and it's not relevant to anything being discussed here. The people who replied to you are saying that it's nonetheless (also) meant to be read as-is -- because that's relevant to whether or not a markdown formatter should try to preserve readability, which was the topic at hand.
- The_Colonel 2y agoThat "also" is critical. It's primary purpose is to be rendered into HTML, but it should also be readable. Now the point is - markdown formatters only format things which won't have an effect in the rendered HTML, so why does it matter? Do you have some meaningful information encoded in markdown which does not translate to HTML? That sounds like a clear anti-pattern, since by rendering to HTML you lose it.
- fenomas 2y agoYou're imagining that the formatter's top priority is to make markdown look similar to its rendered HTML. But that's not a goal of markdown (literally TFA), nor of Prettier, and it's not relevant too what I and some other people use markdown for. If it's relevant for you, great! This thread is me saying it ought to be configurable either way. > so why does it matter? Readability, per the whole thread.