Merge pull request #569 from dekimsey/issue-568

Fixed #568, triple tilde without language causes Gollum to crash
This commit is contained in:
bootstraponline
2012-11-06 17:11:08 -08:00
2 changed files with 17 additions and 2 deletions
+2
View File
@@ -488,8 +488,10 @@ module Gollum
# extract lang from { .ruby } or { #stuff .ruby .indent }
# see http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks
if lang
lang = lang.match(/\.([^}\s]+)/)
lang = lang[1] unless lang.nil?
end
@codemap[id] = cached ?
{ :output => cached } :
+13
View File
@@ -212,6 +212,19 @@ context "Markup" do
assert_equal expected, output
end
# Issue #568
test "tilde code blocks without a language" do
page = 'test_rgx'
@wiki.write_page(page, :markdown,
%Q(~~~
'hi'
~~~
), commit_details)
output = @wiki.page(page).formatted_data
expected = %Q{<div class=\"highlight\"><pre><span class=\"s\">'hi'</span>\n</pre></div>}
assert_equal expected, output
end
test "tilda code blocks #537" do
page = 'test_rgx'
@wiki.write_page(page, :markdown,