Upgraded RedCloth to 3.0.3
This commit is contained in:
parent
2aa1aa8fad
commit
bb2d16c8a1
27 changed files with 1844 additions and 1092 deletions
26
vendor/RedCloth-3.0.3/run-tests.rb
vendored
Normal file
26
vendor/RedCloth-3.0.3/run-tests.rb
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env ruby
|
||||
require 'lib/redcloth'
|
||||
require 'yaml'
|
||||
|
||||
Dir["tests/*.yml"].each do |testfile|
|
||||
YAML::load_documents( File.open( testfile ) ) do |doc|
|
||||
if doc['in'] and doc['out']
|
||||
red = RedCloth.new( doc['in'] )
|
||||
html = if testfile =~ /markdown/
|
||||
red.to_html( :markdown )
|
||||
else
|
||||
red.to_html
|
||||
end
|
||||
puts "---"
|
||||
|
||||
html.gsub!( /\n+/, "\n" )
|
||||
doc['out'].gsub!( /\n+/, "\n" )
|
||||
if html == doc['out']
|
||||
puts "success: true"
|
||||
else
|
||||
puts "out: "; p html
|
||||
puts "expected: "; p doc['out']
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue