This project is archived and is in readonly mode.

#330 ✓resolved
Jimmy Baker

HTML::Document#initialize Node.parse call missing strict argument

Reported by Jimmy Baker | June 4th, 2008 @ 07:27 PM | in 2.1.1

While working on a screen-scraping application using scrAPI, I noticed some parser exceptions when using the gem with Rails. With the help of Scott White, we were able to track down the source of the exceptions.

Looking at line 20 of actionpack-2.1.0/lib/action_controller/vendor/html-scanner/html/document.rb you'll notice the following method call:

node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token)

I think this method call should actually be..

node = Node.parse(node_stack.last, tokenizer.line, tokenizer.position, token, strict)

The local variable 'strict' is passed in as an argument and defaults to false. Passing this parameter on to the Node.parse call will stop the method from throwing exceptions when bad markup is attempting to parse.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>