Merge branch 'master' of github.com:tdreyno/middleman
This commit is contained in:
commit
a63334813f
|
@ -2,6 +2,26 @@ Feature: Markdown support
|
|||
In order to test included Maruku support
|
||||
|
||||
Scenario: Rendering html
|
||||
Given the Server is running at "test-app"
|
||||
When I go to "/markdown.html"
|
||||
Given the Server is running at "markdown-app"
|
||||
When I go to "/index.html"
|
||||
Then I should see "<p>Hello World</p>"
|
||||
|
||||
Scenario: Redcarpet 2 extensions
|
||||
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>"
|
||||
|
9
fixtures/markdown-app/config.rb
Normal file
9
fixtures/markdown-app/config.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
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
|
5
fixtures/markdown-app/source/autolink.html.markdown
Executable file
5
fixtures/markdown-app/source/autolink.html.markdown
Executable file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
http://example.com
|
7
fixtures/markdown-app/source/fenced_code_blocks.html.markdown
Executable file
7
fixtures/markdown-app/source/fenced_code_blocks.html.markdown
Executable file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
a one-line code block
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
4
fixtures/markdown-app/source/index.html.markdown
Executable file
4
fixtures/markdown-app/source/index.html.markdown
Executable file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
Hello World
|
5
fixtures/markdown-app/source/no_intra_emphasis.html.markdown
Executable file
5
fixtures/markdown-app/source/no_intra_emphasis.html.markdown
Executable file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
foo_bar_baz
|
5
fixtures/markdown-app/source/smarty_pants.html.markdown
Executable file
5
fixtures/markdown-app/source/smarty_pants.html.markdown
Executable file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
"Hello"
|
5
fixtures/markdown-app/source/space_after_headers.html.markdown
Executable file
5
fixtures/markdown-app/source/space_after_headers.html.markdown
Executable file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
#this is my header
|
5
fixtures/markdown-app/source/strikethrough.html.markdown
Executable file
5
fixtures/markdown-app/source/strikethrough.html.markdown
Executable file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
~~Nope~~
|
5
fixtures/markdown-app/source/superscript.html.markdown
Executable file
5
fixtures/markdown-app/source/superscript.html.markdown
Executable file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
this is the 2^(nd) time
|
8
fixtures/markdown-app/source/tables.html.markdown
Executable file
8
fixtures/markdown-app/source/tables.html.markdown
Executable file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
layout: false
|
||||
---
|
||||
|
||||
First Header | Second Header
|
||||
------------- | -------------
|
||||
Content Cell | Content Cell
|
||||
Content Cell | Content Cell
|
|
@ -23,7 +23,6 @@ end
|
|||
with_layout false do
|
||||
page "/request-path.html"
|
||||
page "/lorem.html"
|
||||
page "/markdown.html"
|
||||
page "/relative_image.html"
|
||||
page "/inline-css.html"
|
||||
page "/inline-js.html"
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Hello World
|
|
@ -41,7 +41,7 @@ module Middleman
|
|||
def init(name)
|
||||
key = options[:template].to_sym
|
||||
unless Middleman::Templates.registered.has_key?(key)
|
||||
key = :default
|
||||
raise Thor::Error.new "Unknown project template '#{key}'"
|
||||
end
|
||||
|
||||
thor_group = Middleman::Templates.registered[key]
|
||||
|
|
|
@ -2,6 +2,12 @@ module Middleman::Renderers::Markdown
|
|||
class << self
|
||||
def registered(app)
|
||||
require "redcarpet"
|
||||
|
||||
# Forcably disable Redcarpet1 support.
|
||||
# Tilt defaults to this if available, but the compat
|
||||
# layer disables extensions.
|
||||
Object.send(:remove_const, :RedcarpetCompat) if defined? ::RedcarpetCompat
|
||||
|
||||
app.set :markdown_engine, :redcarpet
|
||||
app.set :markdown_engine_prefix, ::Tilt
|
||||
|
||||
|
|
Loading…
Reference in a new issue