mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
still support and test redcarpet
This commit is contained in:
parent
7fb16a4b1b
commit
a7adc20b47
4 changed files with 45 additions and 30 deletions
10
Gemfile
10
Gemfile
|
@ -1,16 +1,17 @@
|
|||
source :rubygems
|
||||
|
||||
group :development do
|
||||
gem "cucumber", "~> 1.1.0"
|
||||
gem "fivemat"
|
||||
gem "aruba", "~> 0.4.11"
|
||||
gem "rake", "~> 0.9.2"
|
||||
gem "rspec", "~> 2.7"
|
||||
gem "rdoc", "~> 3.9"
|
||||
gem "yard", "~> 0.8.0"
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem "cucumber", "~> 1.1.0"
|
||||
gem "fivemat"
|
||||
gem "aruba", "~> 0.4.11"
|
||||
gem "rspec", "~> 2.7"
|
||||
|
||||
# For actual tests
|
||||
gem "sinatra"
|
||||
gem "slim"
|
||||
|
@ -19,6 +20,7 @@ group :test do
|
|||
gem "jquery-rails", "~> 2.0.1"
|
||||
# gem "bootstrap-rails", "0.0.5"
|
||||
# gem "zurb-foundation"
|
||||
gem "redcarpet", "~> 2.1.1"
|
||||
end
|
||||
|
||||
gem "middleman-core", :path => "middleman-core"
|
||||
|
|
|
@ -6,7 +6,7 @@ Feature: Markdown support
|
|||
When I go to "/index.html"
|
||||
Then I should see "<p>Hello World</p>"
|
||||
|
||||
Scenario: Redcarpet 2 extensions
|
||||
Scenario: Markdown extensions (Maruku)
|
||||
Given the Server is running at "markdown-app"
|
||||
When I go to "/smarty_pants.html"
|
||||
Then I should see "“"
|
||||
|
@ -14,18 +14,39 @@ Feature: Markdown support
|
|||
Then I should not see "<em>"
|
||||
When I go to "/tables.html"
|
||||
Then I should see "<table>"
|
||||
# Maruku doesn't support fenced code blocks :-(
|
||||
#When I go to "/fenced_code_blocks.html"
|
||||
#Then I should see "<code>"
|
||||
# or autolink
|
||||
#When I go to "/autolink.html"
|
||||
#Then I should see "<a href"
|
||||
# or del
|
||||
#When I go to "/strikethrough.html"
|
||||
#Then I should see "<del>"
|
||||
When I go to "/space_after_headers.html"
|
||||
Then I should not see "<h1>"
|
||||
# or superscript
|
||||
#When I go to "/superscript.html"
|
||||
#Then I should see "<sup>"
|
||||
|
||||
Scenario: Redcarpet 2 extensions
|
||||
Given a fixture app "markdown-app"
|
||||
And a file named "config.rb" with:
|
||||
"""
|
||||
set :markdown_engine, :redcarpet
|
||||
set :markdown, :no_intra_emphasis => true,
|
||||
:tables => true,
|
||||
:fenced_code_blocks => true,
|
||||
:autolink => true,
|
||||
:strikethrough => true,
|
||||
:lax_html_blocks => true,
|
||||
:space_after_headers => true,
|
||||
:superscript => true#, :smartypants => true
|
||||
|
||||
"""
|
||||
Given the Server is running at "markdown-app"
|
||||
# When I go to "/smarty_pants.html"
|
||||
# Then I should see "“"
|
||||
When I go to "/no_intra_emphasis.html"
|
||||
Then I should not see "<em>"
|
||||
When I go to "/tables.html"
|
||||
Then I should see "<table>"
|
||||
When I go to "/fenced_code_blocks.html"
|
||||
Then I should see "<code>"
|
||||
When I go to "/autolink.html"
|
||||
Then I should see "<a href"
|
||||
When I go to "/strikethrough.html"
|
||||
Then I should see "<del>"
|
||||
When I go to "/space_after_headers.html"
|
||||
Then I should not see "<h1>"
|
||||
When I go to "/superscript.html"
|
||||
Then I should see "<sup>"
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
set :markdown, :smartypants => true,
|
||||
:no_intra_emphasis => true,
|
||||
:tables => true,
|
||||
:fenced_code_blocks => true,
|
||||
:autolink => true,
|
||||
:strikethrough => true,
|
||||
:lax_html_blocks => true,
|
||||
:space_after_headers => true,
|
||||
:superscript => true
|
|
@ -36,16 +36,17 @@ module Middleman
|
|||
else
|
||||
markdown_engine_prefix
|
||||
end
|
||||
|
||||
# Tell tilt to use that engine
|
||||
::Tilt.prefer(markdown_engine_klass)
|
||||
|
||||
|
||||
if markdown_engine == :redcarpet
|
||||
# Forcably disable Redcarpet1 support.
|
||||
# Tilt defaults to this if available, but the compat
|
||||
# layer disables extensions.
|
||||
require "redcarpet"
|
||||
Object.send(:remove_const, :RedcarpetCompat) if defined? ::RedcarpetCompat
|
||||
end
|
||||
|
||||
# Tell tilt to use that engine
|
||||
::Tilt.prefer(markdown_engine_klass)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue