Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

patch to support doctype with test #48

Open
wants to merge 3 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

deanmao commented May 2, 2012

Hi, earlier I made an issue, but figured it would be more efficient if I just wrote the code. This is the issue:
#47

Owner

tautologistics commented May 4, 2012

Thanks! I am going to merge your pull but expand it to generally support XML/HTML declarations of the type "<!" and "<?". Looking into that now...

Contributor

deanmao commented May 4, 2012

Also there was another small issue with attributes that had no values,
something like this:

. The "by-zero" part caused it
to think that it needed to wait for more data and would stop parsing the
rest of the output. The commit below fixes it:

deanmao/node-htmlparser@fdcdd0a

I've been using your new 2.x parser with my fixes on lots of webpages now
-- so far no issues!

On Fri, May 4, 2012 at 6:14 AM, Chris Winberry <
reply@reply.github.com

wrote:

Thanks! I am going to merge your pull but expand it to generally support
XML/HTML declarations of the type "<!" and "<?". Looking into that now...


Reply to this email directly or view it on GitHub:

#48 (comment)

@AndreasMadsen AndreasMadsen referenced this pull request in AndreasMadsen/htmlparser2 Jun 6, 2013

@fb55 fb55 Merge pull request #48 from AndreasMadsen/script-in-script
[tokenizer] text in special tags there looks like a tag ending
46d3b21

This fix was merged with the following commit, but this pull request remains open.
6bcd609

There is an issue with this fix that it fails to update the location correctly. It will increase the col based on the doctype data, but doesn't account for the text. To fix, add the following to the end of _updateLocation line 624

} else if (node.type === Mode.Doctype) {
this._col += 10;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment