libertysoft3 / saidit

The reddit open source fork powering SaidIt
https://saidit.net
Other
228 stars 40 forks source link

Support Github Flavored Markdown #29

Open IAmYhvr opened 5 years ago

IAmYhvr commented 5 years ago

I feel like it would be need if we had GFM.

var x = 5; // Colored Syntax + Fenced code blocks
Foo Bar
Fancy Tables!

I don't know how hard it would be to add support for it. I'll close the issue if it's a total pain in the neck.

wizzwizz4 commented 5 years ago

It's a so-so issue; the hardest part would probably be finding the relevant code. If you feel like going insane, you could try to have a look yourself.

The main issue once you're actually implementing it is providing a dependency on external code, unless we roll our own syntax highlighting system. And do we do it client-side or server-side?

If server-side, I vote this or something with rust-cpython and Bison. Unless something good already exists.

Client-side will slow down every. single. page. load, since we're not mad enough to rely on XSLT. Which, come to think of it, we could…

libertysoft3 commented 5 years ago

Adding github markdown features to Reddit's snudown markdown flavor doesn't sound too bad. Not sure how the syntax highlighting should be be implemented though. I guess snudown could be replaced with a different markdown engine that had syntax highlighting if it was also very fast.

IAmYhvr commented 5 years ago

I mean, at least fenced code blocks would be nice.

wizzwizz4 commented 5 years ago

Instead of GFM, could we implement CommonMark instead?