comparison lib/.svn/text-base/redcloth3.rb.svn-base @ 514:7eba09d624db live

Merge
author Chris Cannam
date Thu, 14 Jul 2011 10:50:53 +0100
parents cbce1fd3b1b7
children
comparison
equal deleted inserted replaced
512:b9aebdd7dd40 514:7eba09d624db
294 # start processor 294 # start processor
295 @pre_list = [] 295 @pre_list = []
296 rip_offtags text 296 rip_offtags text
297 no_textile text 297 no_textile text
298 escape_html_tags text 298 escape_html_tags text
299 # need to do this before #hard_break and #blocks
300 block_textile_quotes text unless @lite_mode
299 hard_break text 301 hard_break text
300 unless @lite_mode 302 unless @lite_mode
301 refs text 303 refs text
302 # need to do this before text is split by #blocks
303 block_textile_quotes text
304 blocks text 304 blocks text
305 end 305 end
306 inline text 306 inline text
307 smooth_offtags text 307 smooth_offtags text
308 308
705 if text =~ BLOCK_RE 705 if text =~ BLOCK_RE
706 tag,tagpre,num,atts,cite,content = $~[1..6] 706 tag,tagpre,num,atts,cite,content = $~[1..6]
707 atts = pba( atts ) 707 atts = pba( atts )
708 708
709 # pass to prefix handler 709 # pass to prefix handler
710 replacement = nil
710 if respond_to? "textile_#{ tag }", true 711 if respond_to? "textile_#{ tag }", true
711 text.gsub!( $&, method( "textile_#{ tag }" ).call( tag, atts, cite, content ) ) 712 replacement = method( "textile_#{ tag }" ).call( tag, atts, cite, content )
712 elsif respond_to? "textile_#{ tagpre }_", true 713 elsif respond_to? "textile_#{ tagpre }_", true
713 text.gsub!( $&, method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) ) 714 replacement = method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content )
714 end 715 end
716 text.gsub!( $& ) { replacement } if replacement
715 end 717 end
716 end 718 end
717 719
718 SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m 720 SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m
719 def block_markdown_setext( text ) 721 def block_markdown_setext( text )
1076 ### and it breaks following lines 1078 ### and it breaks following lines
1077 htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag && !first.match(/<code\s+class="(\w+)">/) 1079 htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag && !first.match(/<code\s+class="(\w+)">/)
1078 line = "<redpre##{ @pre_list.length }>" 1080 line = "<redpre##{ @pre_list.length }>"
1079 first.match(/<#{ OFFTAGS }([^>]*)>/) 1081 first.match(/<#{ OFFTAGS }([^>]*)>/)
1080 tag = $1 1082 tag = $1
1081 $2.to_s.match(/(class\=\S+)/i) 1083 $2.to_s.match(/(class\=("[^"]+"|'[^']+'))/i)
1082 tag << " #{$1}" if $1 1084 tag << " #{$1}" if $1
1083 @pre_list << "<#{ tag }>#{ aftertag }" 1085 @pre_list << "<#{ tag }>#{ aftertag }"
1084 end 1086 end
1085 elsif $1 and codepre > 0 1087 elsif $1 and codepre > 0
1086 if codepre - used_offtags.length > 0 1088 if codepre - used_offtags.length > 0