lamernews icon indicating copy to clipboard operation
lamernews copied to clipboard

Markdown support

Open JonnieCache opened this issue 12 years ago • 5 comments

Or at least some subset of it.

If we want to keep it pure ruby then the obvious choice of parser/renderer is kramdown. This is not as fast or as secure as that Redcarpet library github wrote, but thats probably not a problem right now

My instinct would be to create a separate Markdown module to encapsulate everything, making it easier to swap it for a C based renderer in future if needed. Then just store a body_html string on the comment objects which gets rendered to the page, alongside the original user-submitted markdown for use when a comment is edited.

I don't know, maybe extracting it to a module is unnecessary.

Thoughts?

JonnieCache avatar Oct 23 '11 17:10 JonnieCache

I'm very much in favor of Markdown, and as I mention elsewhere, it solves a few problems at once. Overall though I would go for Redcarpet since it's faster and safer. That said, I have zero experience with kramdown, so maybe it has benefits I'm not thinking of.

telemachus avatar Oct 23 '11 17:10 telemachus

+1 for Redcarpet

dannymcc avatar Oct 23 '11 17:10 dannymcc

I would personally vote for redcarpet as well, however it is not pure ruby, and this goes against antirez's stated goal of having as few dependencies as possible.

Obviously we aren't going to be able to follow the "Do everything you can to avoid depending on new ruby gems." rule, writing our own markdown interpreter from scratch just for this project would be absolute madness.

The only way that would be appropriate would be if we wanted to only support a very small subset of markdown, like on HN.

Personally I am actually in favor of that, as it will keep the comments from getting too ugly.

EDIT: whoops, hit the comment-and-close button by mistake. Sorry.

JonnieCache avatar Oct 23 '11 18:10 JonnieCache

Related issues:

  • #6 Link urls in comments
  • #20 Good support for quoting other guys messages

seppo0010 avatar Oct 26 '11 23:10 seppo0010

:+1: Looks like this particular feature request needed some love.

EchoJS uses LamerNews and Markdown would be pretty sweet :)

basicallydan avatar Mar 16 '14 22:03 basicallydan