Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki

This commit is contained in:
Jacques Distler 2010-11-03 23:52:06 -05:00
commit 88291ee4a2
5 changed files with 19 additions and 9 deletions

View file

@ -3,6 +3,7 @@ gem "sqlite3-ruby", :require => "sqlite3"
gem "itextomml", ">=1.4.5" gem "itextomml", ">=1.4.5"
gem "mongrel", ">=1.2.0.pre2" gem "mongrel", ">=1.2.0.pre2"
gem "rubyzip" gem "rubyzip"
gem "RedCloth", ">=4.0.0"
gem "erubis" gem "erubis"
gem "nokogiri" gem "nokogiri"
gem "rake" gem "rake"

View file

@ -478,7 +478,7 @@ EOL
"<meta http-equiv=\"Refresh\" content=\"0;URL=HomePage.#{html_ext}\" /></head></html>" "<meta http-equiv=\"Refresh\" content=\"0;URL=HomePage.#{html_ext}\" /></head></html>"
end end
dir = Rails.root.join('public') dir = Rails.root.join('public')
Dir["#{dir}/**/*"].each do |f| Dir["#{dir}/{images,javascripts,s5,stylesheets}/**/*"].each do |f|
zip_out.add "public#{f.sub(dir.to_s,'')}", f zip_out.add "public#{f.sub(dir.to_s,'')}", f
end end
end end

View file

@ -6,6 +6,7 @@ require 'maruku'
require 'maruku/ext/math' require 'maruku/ext/math'
require_dependency 'rdocsupport' require_dependency 'rdocsupport'
require 'redcloth' require 'redcloth'
require 'oldredcloth'
# The markup engines are Chunks that call the one of RedCloth # The markup engines are Chunks that call the one of RedCloth
# or RDoc to convert text. This markup occurs when the chunk is required # or RDoc to convert text. This markup occurs when the chunk is required
@ -113,7 +114,7 @@ module Engines
class Mixed < AbstractEngine class Mixed < AbstractEngine
def mask def mask
@content.as_utf8 @content.as_utf8
redcloth = RedCloth.new(@content, @content.options[:engine_opts]) redcloth = OldRedCloth.new(@content, @content.options[:engine_opts])
redcloth.filter_html = false redcloth.filter_html = false
redcloth.no_span_caps = false redcloth.no_span_caps = false
html = redcloth.to_html html = redcloth.to_html

View file

@ -164,7 +164,7 @@
# #
# class RedCloth::Textile.new( str ) # class RedCloth::Textile.new( str )
class RedCloth < String class OldRedCloth < String
VERSION = '3.0.3' VERSION = '3.0.3'
DEFAULT_RULES = [:textile, :markdown] DEFAULT_RULES = [:textile, :markdown]

View file

@ -358,11 +358,12 @@ END_THM
assert_match_markup_parsed_as(re, textile_and_markdown) assert_match_markup_parsed_as(re, textile_and_markdown)
set_web_property :markup, :textile set_web_property :markup, :textile
assert_markup_parsed_as( assert_markup_parsed_as(
"<p>Markdown heading<br/>================</p>\n\n\n\t<h2>Textile heading</h2>" + "<p>Markdown heading<br/>\n====</p>\n<h2>Textile heading</h2>" +
"\n\n\n\t<p><strong>some</strong> <b>text</b> <em>with</em> <del>styles</del></p>" + "\n<p><strong>some</strong> <b>text</b> <em>with</em> <del>styles</del></p>" +
"\n\n\n\t<ul>\n\t<li>list 1</li>\n\t\t<li>list 2</li>\n\t</ul>", "\n<ul>\n\t<li>list 1</li>\n\t<li>list 2</li>\n</ul>",
textile_and_markdown) textile_and_markdown)
# Mixed Textile+Markdown markup not supported by RedCloth 4.x
set_web_property :markup, :mixed set_web_property :markup, :mixed
assert_markup_parsed_as( assert_markup_parsed_as(
"<h1>Markdown heading</h1>\n\n\n\t<h2>Textile heading</h2>\n\n\n\t" + "<h1>Markdown heading</h1>\n\n\n\t<h2>Textile heading</h2>\n\n\n\t" +
@ -370,7 +371,14 @@ END_THM
"<ul>\n\t<li>list 1</li>\n\t\t<li>list 2</li>\n\t</ul>", "<ul>\n\t<li>list 1</li>\n\t\t<li>list 2</li>\n\t</ul>",
textile_and_markdown) textile_and_markdown)
end end
def test_textile_pre
set_web_property :markup, :textile
assert_markup_parsed_as("<pre>\n<code>\n a == 16\n</code>\n</pre>\n<p>foo bar" +
"<br/>\n<pre><br/>\n<code>\n b == 16\n</code><br/>\n</pre></p>",
"<pre>\n<code>\n a == 16\n</code>\n</pre>\nfoo bar\n<pre>\n<code>\n b == 16\n</code>\n</pre>")
end
def test_rdoc def test_rdoc
set_web_property :markup, :rdoc set_web_property :markup, :rdoc
@ -461,7 +469,7 @@ END_THM
set_web_property :markup, :textile set_web_property :markup, :textile
assert_markup_parsed_as( assert_markup_parsed_as(
"<p>$$<span class='newWikiWord'>foo<a href='../show/foo'>?" + "<p>$$<span class='newWikiWord'>foo<a href='../show/foo'>?" +
"</a></span>$$<br/>$<span class='newWikiWord'>foo<a " + "</a></span>$$<br/>\n$<span class='newWikiWord'>foo<a " +
"href='../show/foo'>?</a></span>$</p>", "href='../show/foo'>?</a></span>$</p>",
"$$[[foo]]$$\n$[[foo]]$") "$$[[foo]]$$\n$[[foo]]$")
end end