gitspective icon indicating copy to clipboard operation
gitspective copied to clipboard

parse comments with github-flavoured-markdown

Open michaelficarra opened this issue 12 years ago • 7 comments

All the comments (and issue text, and probably others) look ugly because they're not being formatted the way they were intended.

michaelficarra avatar May 11 '12 20:05 michaelficarra

I don't think I'll implement this. I don't know of any GFM javascript libraries and I don't know if I want to maintain one. If you find one, please pass it along.

zmoazeni avatar May 11 '12 21:05 zmoazeni

  • Source: https://github.com/github/github-flavored-markdown
  • Docs: http://github.github.com/github-flavored-markdown/

edit: Also:

  • https://gist.github.com/118964
  • https://gist.github.com/2349475

michaelficarra avatar May 11 '12 21:05 michaelficarra

I saw that and:

GitHub now has previews on all inputs that use GFM. This live preview should be considered deprecated. It may not render exactly the same way github.com will due to differences in markdown libraries.

zmoazeni avatar May 11 '12 21:05 zmoazeni

Even better! In that case, just have the user's browser "preview" each comment to render it. Just POST to https://github.com/preview with the proper text and repository values. It should return the HTML that you can use to replace the markdown. You can even do it lazily as they enter the viewport.

michaelficarra avatar May 11 '12 21:05 michaelficarra

Oooh. That may work nicely. I may toy with that.

zmoazeni avatar May 11 '12 21:05 zmoazeni

Oooh, it even accepts requests using GET: https://github.com/preview?text=Awesome!%20%237&repository=4257391

michaelficarra avatar May 11 '12 21:05 michaelficarra

There's also marked, which is extremely fast, compliant, implements GFM, and works on both node and the client side: https://github.com/chjj/marked

tkazec avatar May 16 '12 06:05 tkazec