Index: test/unit/helpers/application_helper_test.rb =================================================================== --- test/unit/helpers/application_helper_test.rb (revision 2594) +++ test/unit/helpers/application_helper_test.rb (working copy) @@ -50,7 +50,7 @@ '(see "inline link":http://www.foo.bar/Test)' => '(see inline link)', '(see "inline link":http://www.foo.bar/Test).' => '(see inline link).', 'www.foo.bar' => 'www.foo.bar', - 'http://foo.bar/page?p=1&t=z&s=' => 'http://foo.bar/page?p=1&t=z&s=', + 'http://foo.bar/page?p=1&t=z&s=' => 'http://foo.bar/page?p=1&t=z&s=', 'http://foo.bar/page#125' => 'http://foo.bar/page#125', 'http://foo@www.bar.com' => 'http://foo@www.bar.com', 'http://foo:bar@www.bar.com' => 'http://foo:bar@www.bar.com', Index: lib/redcloth3.rb =================================================================== --- lib/redcloth3.rb (revision 2594) +++ lib/redcloth3.rb (working copy) @@ -309,7 +309,8 @@ retrieve text text.gsub!( /<\/?notextile>/, '' ) - text.gsub!( /x%x%/, '&' ) + ### Disabled as it just bugs in pre/code blocks!! + #text.gsub!( /x%x%/, '&' ) clean_html text if filter_html text.strip! text @@ -968,8 +969,10 @@ ## turn any incoming ampersands into a dummy character for now. ## This uses a negative lookahead for alphanumerics followed by a semicolon, ## implying an incoming html entity, to be skipped - - text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" ) + + ### Disabled as it just bugs in pre/code blocks + ### try: blah.map(&:test) in a code block... + #text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" ) end def no_textile( text ) @@ -1050,7 +1053,7 @@ codepre, used_offtags = 0, {} text.gsub!( OFFTAG_MATCH ) do |line| if $3 - offtag, aftertag = $4, $5 + first, offtag, aftertag = $3, $4, $5 codepre += 1 used_offtags[offtag] = true if codepre - used_offtags.length > 0 @@ -1058,9 +1061,13 @@ @pre_list.last << line line = "" else - htmlesc( aftertag, :NoQuotes ) if aftertag + ### htmlesc is disabled between CODE tags which will be parsed with highlighter + ### Regexp in formatter.rb is : /\s?(.+)/m + ### NB: some changes were made not to use $N variables, because we use "match" + ### and it breaks following lines + htmlesc( aftertag, :NoQuotes ) if (aftertag && !first.match(//)) line = "" - $3.match(/<#{ OFFTAGS }([^>]*)>/) + first.match(/<#{ OFFTAGS }([^>]*)>/) tag = $1 $2.to_s.match(/(class\=\S+)/i) tag << " #{$1}" if $1