Hacker News new | ask | show | jobs
by matharmin 2476 days ago
Markdown is nice for composing, but not as a standard to be supported by many clients. CommonMark is an improvement, but there is way to many ambiguities and differences in supported features over different markdown parsers for it to be feasibly used as a standard.

Markdown is also not any better than HTML in terms of security - most markdown parsers allow passing through arbitrary HTML, and then depend on sanitizing the HTML for security.

What you are asking for is effectively a smaller subset of HTML to be used for for email (which is kind of how it started...)

3 comments

This is a bigger issue than most people care to admit. I post stuff to a number of different sites that support "Markdown" and not a single one agrees on even something a simple as how to format a hyperlink. I end up having to hit the help page on every site to remember which syntax they use, if they even support the feature at all. HTML might be "ugly", but at least it is consistent.
I wish there was a browser extension to handle that. It would provide an editing area that would allow you to edit using the same markup on different sites, and when you are done would translate to whatever markup format that site uses and fill in the site's edit area with that.
There are some bits of typical markdown syntax that I really don't like. Like pasting code requires you to add 4 spaces to the start of every line and an extra linefeed between each line. That's a lot of work and every time I do it I say "How is this better than <pre></pre>?"

I've yet to see what I'd really like: preformatted text being surrounded by markers that make it easy to paste in, like so:

    Some regular text

    vvvvv

    Preformatted text

    ^^^^^
It would be cool if the extension could do that and then do all of that obnoxious formatting for me. Or heck, it could be a full up WYSIWYG editor.
The most common way to do this is with triple backticks:

    Some regular text

    ```
    Preformatted text
    ```
While this isn't in the original spec (https://daringfireball.net/projects/markdown/syntax#precode) it's supported by GitHub, Stack Overflow, and most other places I find myself using a markdown flavor.
This syntax even made its way into CommonMark (https://spec.commonmark.org/0.29/#fenced-code-blocks)
> ...every time I do it I say "How is this better than <pre></pre>?"...

From Gruber’s Markdown spec:

> Readability, however, is emphasized above all else.

Not sure why you're being down-voted. (As usual here, only clicking a down-vote button contributes little value.)

- You are correct that implementing markdown consistently is hard because there is no real spec. CommonMark is a spec, which helps, but a heroically thorough spec, so it's still not exactly trivial to implement.

- You are correct that markdown can escape to HTML. Indeed certain marketing email "features" probably would do this?

If I am missing something maybe someone could make an actual contribution to the discussion and explain.

In any case I think by far the most important point was made elsewhere: Google AMP is awful for the web and for email, both.

p.s. edit: Actually, I think the even more important point is that anything except plain text email is awful. :) So there, sure, use markdown or org-mode formatting conventions. Humans are pretty good at handling messy human protocols.

Why is markdown so popular? It seems so braindead.
# why is markdown so popular? ## (my opinion)

Markdown is fast to type for the majority of use cases since you have:

- bullet points

- headings

- __bold__

- __italic__

- `inline code`

- etc

```

fn you_even(_have: &str) -> &str { "nifty little code blocks without needing to indent" }

```

And more importantly, markdown syntax preserves the structure of the document without harming legibility, unlike say latex or HTML. That limits it, since the syntax is small, but also reduces friction in learning/writing markdown.

Also, Reddit + GitHub.

Sorry, poor choice of words.

I thought hacker news used markdown, but I guess has its own thing.

I can see the severely constrained formatting options of hacker news has both positive and negative consequences.