Tim Harper
2007-Aug-29 23:20 UTC
Patch - bug fix for RedCloth when using !image! and :filter_html in combination
RedCloth.new("!image!", [:filter_html]).to_html will cause the following error: "error occurred while evaluating nil.gsub" This patch will fix it. Can you apply this please to next release of RedCloth? Thanks! Tim --- redcloth_old.rb 2007-08-29 17:02:51.537099600 -0600 +++ redcloth.rb 2007-08-29 17:04:34.666099600 -0600 @@ -1115,7 +1115,7 @@ if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i attrv = $1 next if prop == ''src'' and attrv =~ %r{^(?!http)\w+:} - pcs << "#{prop}=\"#{$1.gsub(''"'', ''\\"'')}\"" + pcs << "#{prop}=\"#{attrv.gsub(''"'', ''\\"'')}\"" break end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/redcloth-upwards/attachments/20070829/a8690a2e/attachment-0001.html