Changeset 299
- Timestamp:
- 04/16/2008 06:37:22 (7 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
ext/redcloth_scan/redcloth_scan.rl (modified) (2 diffs)
-
lib/formatters/html.rb (modified) (1 diff)
-
test/test_parser.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ext/redcloth_scan/redcloth_scan.rl
r298 r299 71 71 table = ( tdef? trows >{INLINE(table, table_open);} ) >{ reg = NULL; } ; 72 72 73 # info 74 redcloth_version = "RedCloth::VERSION" (CRLF* EOF | double_return) ; 75 73 76 pre_tag := |* 74 77 pre_tag_end { CAT(block); DONE(block); fgoto main; }; … … 281 284 link_alias { rb_hash_aset(refs_found, rb_hash_aref(regs, ID2SYM(rb_intern("text"))), rb_hash_aref(regs, ID2SYM(rb_intern("href")))); DONE(block); }; 282 285 aligned_image { rb_hash_aset(regs, ID2SYM(rb_intern("type")), plain_block); fgoto block; }; 286 redcloth_version { INLINE(html, redcloth_version); }; 283 287 blank_line => cat; 284 288 default -
trunk/lib/formatters/html.rb
r274 r299 214 214 txt.gsub(/&/, '&') 215 215 end 216 217 def redcloth_version(opts) 218 p(:text => RedCloth::VERSION) 219 end 216 220 end -
trunk/test/test_parser.rb
r289 r299 30 30 assert_match /td/, red("html", %Q{|one || |\nthree | four |}) 31 31 end 32 33 def test_redcloth_version_in_output 34 assert_equal "<p>#{RedCloth::VERSION}</p>", red("html", "RedCloth::VERSION") 35 end 36 37 def test_redcloth_version_only_on_line_by_itself 38 input = "RedCloth::VERSION won't output the RedCloth::VERSION unless it's on a line all by itself.\n\nRedCloth::VERSION" 39 html = "<p>RedCloth::<span class=\"caps\">VERSION</span> won’t output the RedCloth::<span class=\"caps\">VERSION</span> unless it’s on a line all by itself.</p>\n<p>#{RedCloth::VERSION}</p>" 40 assert_equal html, red("html", input) 41 end 32 42 33 43 end