Douglas F Shearer
2007-Dec-04 15:05 UTC
Bug: NoMethodError: private method `gsub'' called for nil:NilClass
Hi there.
I''m using RedCloth as part of a social network''s blog system.
I came across the following bug when an img tag with the src attribute
is inputted, and filter_html is set to true.
I have pasted the code sample below.
>> require ''RubyGems''
=> true
>> require ''RedCloth''
=> true
>> RedCloth.new(''<img
src="">'',[:filter_html]).to_html
NoMethodError: private method `gsub'' called for nil:NilClass
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1118:in `clean_html''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in `each''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in `clean_html''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in `each''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in `clean_html''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in `gsub!''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in `clean_html''
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:310:in `to_html''
from (irb):3
>>
Thanks.
Douglas F Shearer
dougal.s at gmail.com
http://douglasfshearer.com
Steve Austen
2010-Nov-29 14:14 UTC
Bug: NoMethodError: private method `gsub'' called for nil:NilClass
hi its seems like you have done a hard work on it. I have got lots of information from your post. Really appreciate your work.!! It was describe very nicely keep us doing good work.. http://www.dealsourcedirect.com/ion-tape2pc.html -- Posted via http://www.ruby-forum.com/.
Jason Garber
2010-Nov-30 00:18 UTC
Bug: NoMethodError: private method `gsub'' called for nil:NilClass
I copied it into a Lighthouse ticket. Thanks for reporting the bug http://jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/200-nil-gsub-when-img-with-src-and-filter_html-is-on On Tue, Dec 4, 2007 at 9:05 AM, Douglas F Shearer <dougal.s at gmail.com>wrote:> Hi there. > > I''m using RedCloth as part of a social network''s blog system. > > I came across the following bug when an img tag with the src attribute > is inputted, and filter_html is set to true. > > I have pasted the code sample below. > > >> require ''RubyGems'' > => true > >> require ''RedCloth'' > => true > >> RedCloth.new(''<img src="">'',[:filter_html]).to_html > NoMethodError: private method `gsub'' called for nil:NilClass > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1118:in `clean_html'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in `each'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1113:in `clean_html'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in `each'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1112:in `clean_html'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in `gsub!'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:1107:in `clean_html'' > from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ > ruby/gems/1.8/gems/RedCloth-3.0.4/lib/RedCloth.rb:310:in `to_html'' > from (irb):3 > >> > > Thanks. > > Douglas F Shearer > dougal.s at gmail.com > http://douglasfshearer.com > > _______________________________________________ > Redcloth-upwards mailing list > Redcloth-upwards at rubyforge.org > http://rubyforge.org/mailman/listinfo/redcloth-upwards >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/redcloth-upwards/attachments/20101129/f1135145/attachment.html>