Project

General

Profile

Defect #1416 » redcloth_arobas.diff

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

View differences:

lib/redcloth3.rb (working copy)
611 611
        text.gsub!( CODE_RE ) do |m|
612 612
            before,lang,code,after = $~[1..4]
613 613
            lang = " lang=\"#{ lang }\"" if lang
614
            rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }" )
614
            rip_offtags( "#{ before }<code#{ lang }>#{ code }</code>#{ after }", false )
615 615
        end
616 616
    end
617 617

  
......
1044 1044
        end
1045 1045
    end
1046 1046

  
1047
    def rip_offtags( text )
1047
    def rip_offtags( text, escape_aftertag=true )
1048 1048
        if text =~ /<.*>/
1049 1049
            ## strip and encode <pre> content
1050 1050
            codepre, used_offtags = 0, {}
......
1058 1058
                        @pre_list.last << line
1059 1059
                        line = ""
1060 1060
                    else
1061
                        htmlesc( aftertag, :NoQuotes ) if aftertag
1061
                        htmlesc( aftertag, :NoQuotes ) if aftertag && escape_aftertag
1062 1062
                        line = "<redpre##{ @pre_list.length }>"
1063 1063
                        $3.match(/<#{ OFFTAGS }([^>]*)>/)
1064 1064
                        tag = $1
(1-1/2)