Project

General

Profile

Defect #1416 » redcloth_arobas.diff

Jean-Baptiste Barth, 2009-03-22 11:57

View differences:

lib/redcloth3.rb (working copy)
text.gsub!( CODE_RE ) do |m|
before,lang,code,after = $~[1..4]
lang = " lang=\"#{ lang }\"" if lang
rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }" )
rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }", false )
end
end
......
end
end
def rip_offtags( text )
def rip_offtags( text, escape_aftertag=true )
if text =~ /<.*>/
## strip and encode <pre> content
codepre, used_offtags = 0, {}
......
@pre_list.last << line
line = ""
else
htmlesc( aftertag, :NoQuotes ) if aftertag
htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag
line = "<redpre##{ @pre_list.length }>"
$3.match(/<#{ OFFTAGS }([^>]*)>/)
tag = $1
(1-1/2)