Changeset 128
- Timestamp:
- 05/19/2006 15:52:10 (2 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 modified
-
lib/redcloth/base.rb (modified) (1 diff)
-
run-tests.rb (modified) (1 diff)
-
test/textile_hardbreaks.yml (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/redcloth/base.rb
r124 r128 392 392 393 393 def hard_break( text ) 394 text.gsub!( /(.)\n(?!\ Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks394 text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />" ) if hard_breaks 395 395 end 396 396 -
trunk/run-tests.rb
r97 r128 11 11 errors = [] 12 12 tests = 0 13 options = (testfile =~ /hardbreaks/) ? [:hard_breaks] : [] 14 13 15 print File.basename(testfile)+":\n\t" 14 16 YAML::load_documents( File.open( testfile ) ) do |doc| 15 17 if doc['in'] and doc['out'] 16 18 tests += 1 17 red = RedCloth.new( doc['in'] )19 red = RedCloth.new( doc['in'], options ) 18 20 html = if testfile =~ /markdown/ 19 21 red.to_html( :markdown ) 20 22 elsif testfile =~ /docbook/ 21 23 red.to_docbook 24 elsif testfile =~ /textile/ 25 red.to_html( :textile ) 22 26 else 23 27 red.to_html