Hacker News new | ask | show | jobs
by captn3m0 20 days ago
I keep writing the same comment every time this is brought up, but browsers need to support text/markdown.
3 comments

You'll need to be more specific since there are many variants of Markdown and the original explicitly permits arbitrary html.
CommonMark is pretty standard (even if not perfect) and you're in the browser anyway so arbitrary html is not really a problem..
Umm, see what problem this thread is trying to solve using markdown.
Technically depending on the implementation, markdown is a superset of HTML.
Markdown? Terrible "spec".

Browsers already support XML.

You can spin up a HTML-but-restricted XML grammar (with extra stuff even, like footnotes and stuff) and a CSS file in maybe half an hour, and it'll render in your browser just fine.

(Yeah, it'll be missing all the accessibility provisions, but you know, the base to build on is there, whereas "MarkDown in the browser" rendering has been often suggested and never implemented).

Just choose a subset of Markdown that doesn't allow inline HTML.

This always comes up as an intractible problem in these discussions but I don't get it. If you're making a new protocol you can define a Markdown spec for that protocol. As long as it renders sensibly as plaintext then it's fine. Gemtext is basically already that.

Also let's be honest - almost everyone looking for an alternative to the web is a techie jaded about the modern web stack and its complexity who wants to reinvent things according to their own specific preferences and hyperfixations, mostly because it's fun. Such people tend to like markdown and not like XML or HTML so the chances of anyone making a web alternative that uses either is practically moot, regardless of any actual technical merit or interoperability with the web stack. And for a lot of people not being compatible with the web would be a feature, not a bug.

Can't argue with the success of Markdown.

It's still a lousy "spec", and, again, I often see people wishing for a Markdown web browser, but I don't see anyone implementing such a thing. You'd think it would be an instant success!

Yeah, I am a jaded techie. I wanted to like Markdown and used it extensively for a little while and wound up utterly loathing it for anything other than jotting down a quick, ephemeral note.

But, back to my original response: if you want a usable alternative to HTML, right now, a simple XML grammar + style sheet will deliver that. Firefox, Chrome, Edge and Safari will render it nicely. Heck, even Docbook would work (which is overkill, but has vast and mature tooling available).