Compare commits

...

3 Commits

Author SHA1 Message Date
bootstraponline 72ee08b5ab Release 2.2.5 2012-10-14 11:21:56 -06:00
bootstraponline 45547624e4 Improve tilde fence support
More than 3 tildes can be used. The code block must end with the same amount of tildes used to open the code block.

Fix #537

http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks
2012-10-14 11:02:45 -06:00
bootstraponline f928cfa8be Don't ship Lorem ipsum in gem 2012-10-13 20:21:08 -06:00
5 changed files with 25 additions and 8 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ task :gemspec => :validate do
split("\n").
sort.
reject { |file| file =~ /^\./ }.
reject { |file| file =~ /^(rdoc|pkg|test)/ }.
reject { |file| file =~ /^(rdoc|pkg|test|Home\.md)/ }.
map { |file| " #{file}" }.
join("\n")
+2 -3
View File
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = ">= 1.8.7"
s.name = 'gollum'
s.version = '2.2.4'
s.date = '2012-10-13'
s.version = '2.2.5'
s.date = '2012-10-14'
s.rubyforge_project = 'gollum'
s.summary = "A simple, Git-powered wiki."
@@ -47,7 +47,6 @@ Gem::Specification.new do |s|
s.files = %w[
Gemfile
HISTORY.md
Home.md
LICENSE
README.md
Rakefile
+1 -1
View File
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
module Gollum
VERSION = '2.2.4'
VERSION = '2.2.5'
def self.assets_path
::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
+8 -3
View File
@@ -511,10 +511,15 @@ module Gollum
#
# Returns the placeholder'd String data.
def extract_code(data)
data.gsub!(/^([ \t]*)~~~ ?([^\r\n]+)?\r?\n(.+?)\r?\n\1~~~\r?$/m) do
data.gsub!(/^([ \t]*)(~~~+) ?([^\r\n]+)?\r?\n(.+?)\r?\n\1(~~~+)\r?$/m) do
m_indent = $1
m_lang = $2
m_code = $3
m_start = $2 # ~~~
m_lang = $3
m_code = $4
m_end = $5 # ~~~
# start and finish tilde fence must be the same length
return '' if m_start.length != m_end.length
lang = m_lang ? m_lang.strip : nil
id = Digest::SHA1.hexdigest("#{lang}.#{m_code}")
+13
View File
@@ -236,6 +236,19 @@ context "Markup" do
assert_equal expected, output
end
test "~~~ code blocks #537 with lots of tildes" do
page = 'test_rgx'
@wiki.write_page(page, :markdown,
%Q(~~~~~~ {#hi .ruby .sauce}
~~
'hi'~
~~~~~~
), commit_details)
output = @wiki.page(page).formatted_data
expected = %Q{<div class=\"highlight\"><pre><span class=\"o\">~~</span>\n<span class=\"s1\">'hi'</span><span class=\"o\">~</span>\n</pre></div>}
assert_equal expected, output
end
test "wiki link within code block" do
@wiki.write_page("Potato", :markdown, " sed -i '' 's/[[:space:]]*$//'", commit_details)
page = @wiki.page("Potato")