fredoliveira/commonplace — Issue #2: Redcarpet 2.0 == fail
Author: pelted
Created: 2011-12-07 23:24:08+00:00
State: open

It looks like **Redcarpet** has been bumped to 2.0 and thus line **97** of **lib/commonplace.rb** tosses up

undefined method 'new' for Redcarpet:Module

**My quick fix:**

Change:

return Redcarpet.new(parse_links(@content))

to:

markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML)
return markdown.render(parse_links(@content))

I'm relatively new to Ruby, my first try was changing the gemfile to read

gem "redcarpet", "1.17.2"

But since **bundle install** or **update** now install 2.0 this was not working. I'm not sure what would need to be done to make this conditional in the commonplace.rb file to deal with the 2.0 and pre 2.0 versions of Redcarpet.

I'm guessing though that instantiating a new Markdown instance on every page load is probably not a good idea either. But for the moment this works.