Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   hpricot 0.4.76 chokes on empty comment. (http://www.velocityreviews.com/forums/t836063-hpricot-0-4-76-chokes-on-empty-comment.html)

Ron M 12-05-2006 01:11 AM

hpricot 0.4.76 chokes on empty comment.
 
Hpricot's choking on some pages complaining about nil
in Comment#parse. I can't remember the HTML page that
was parsing it; but this patch fixes the problem for me.

Why? If you're around, should something like this be checked
in the main project?

Ron


desktop2:/usr/local/lib/ruby/gems/1.8/gems/hpricot-0.4.76/lib/hpricot% diff -c parse.rb.orig parse.rb
*** parse.rb.orig Fri Dec 1 16:53:58 2006
--- parse.rb Fri Dec 1 16:54:04 2006
***************
*** 261,267 ****

def Comment.parse(content)
result = Comment.new(content)
! result.raw_string = "<!--" + content + "-->"
result
end

--- 261,267 ----

def Comment.parse(content)
result = Comment.new(content)
! result.raw_string = "<!--" + (content||'') + "-->"
result
end



_why 12-05-2006 04:28 PM

Re: hpricot 0.4.76 chokes on empty comment.
 
On Tue, Dec 05, 2006 at 10:11:42AM +0900, Ron M wrote:
> Hpricot's choking on some pages complaining about nil
> in Comment#parse. I can't remember the HTML page that
> was parsing it; but this patch fixes the problem for me.
>
> Why? If you're around, should something like this be checked
> in the main project?


It's in. Way to be, Ron!

_why



All times are GMT. The time now is 02:02 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.