From 6f4c1b816a36a02b84379f69d4d18a25f8351f3a Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sun, 11 Dec 2011 16:02:40 -0800 Subject: [PATCH] default to redcarpet for markdown. closes #196 --- CHANGELOG.md | 1 + fixtures/clean-app/source/index.html.haml | 7 +------ .../source/{index.html.haml => index.html.slim} | 4 ++-- lib/middleman/renderers/markdown.rb | 11 ++--------- middleman.gemspec | 2 +- 5 files changed, 7 insertions(+), 18 deletions(-) rename fixtures/test-app/source/{index.html.haml => index.html.slim} (81%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f4577e..9c064fd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * Unified callback solution * Removed Slim and Maruku from base install. Will need to be installed and required by the user (in - config.rb) * Activate mobile html5boilerplate template +* Update to Redcarpet for Markdown (breaks Haml :markdown filter) 2.0.14 ==== diff --git a/fixtures/clean-app/source/index.html.haml b/fixtures/clean-app/source/index.html.haml index 6ef080c6..be6c2513 100755 --- a/fixtures/clean-app/source/index.html.haml +++ b/fixtures/clean-app/source/index.html.haml @@ -1,6 +1 @@ -%h1 Welcome - -:markdown - ## H2 - - Paragraph \ No newline at end of file +h1 Welcome \ No newline at end of file diff --git a/fixtures/test-app/source/index.html.haml b/fixtures/test-app/source/index.html.slim similarity index 81% rename from fixtures/test-app/source/index.html.haml rename to fixtures/test-app/source/index.html.slim index 221c0134..e8edb243 100755 --- a/fixtures/test-app/source/index.html.haml +++ b/fixtures/test-app/source/index.html.slim @@ -1,9 +1,9 @@ -%h1 Welcome +h1 Welcome = image_tag "Chrome_Logo.svg" = image_tag "cfb_tomb-perennial-energy.svgz" -:markdown +markdown: ## H2 Paragraph \ No newline at end of file diff --git a/lib/middleman/renderers/markdown.rb b/lib/middleman/renderers/markdown.rb index 92803842..3852b08a 100644 --- a/lib/middleman/renderers/markdown.rb +++ b/lib/middleman/renderers/markdown.rb @@ -1,15 +1,8 @@ module Middleman::Renderers::Markdown class << self def registered(app) - app.set :markdown_engine, nil - - # TODO: Switch to Redcarpet once Haml 3.2.0 ships - begin - require "rdiscount" - app.set :markdown_engine, :rdiscount - rescue LoadError - end - + require "redcarpet" + app.set :markdown_engine, :redcarpet app.set :markdown_engine_prefix, ::Tilt app.after_configuration do diff --git a/middleman.gemspec b/middleman.gemspec index c74ed50f..89e7084d 100644 --- a/middleman.gemspec +++ b/middleman.gemspec @@ -36,13 +36,13 @@ Gem::Specification.new do |s| s.add_dependency("sprockets", ["~> 2.1.2"]) s.add_dependency("sprockets-sass", ["~> 0.5.0"]) s.add_dependency("guard", ["~> 0.8.8"]) + s.add_dependency("redcarpet", ["~> 2.0.0"]) # OSX s.add_dependency("rb-fsevent") # Development and test s.add_development_dependency("slim") - s.add_development_dependency("rdiscount") s.add_development_dependency("sinatra") s.add_development_dependency("coffee-filter", ["~> 0.1.1"]) s.add_development_dependency("liquid", ["~> 2.2.0"])