itteco/iframely — pull request #20 by panzi (2013-07-07 01:13:24+00:00)
Title: port to htmlparser2

This uses `htmlparser2` instead of `sax` and thus it eats documents that are valid HTML but invalid XML (and I guess even some broken HTML).

I also made a tiny change to the oEmbed/1 XML parser. I moved `encodeText` into the `closetag` event because in theory a text chunk might end right in the middle of a multibyte character.

I didn't run the tests because I don't know how. Can someone explain this to me? I did a few manual tests.

Off topic: I noticed very strange not always reproducible encoding errors only when using node 0.10, no matter whether I use `sax` or `htmlparser2`. Does anyone else experience this? It's alright with node 0.8, but with node 0.8 I get SSL errors on `https://*.google.*`. I debugged it and it's really the data I get back from `request` that is messed up. I didn't look further than that.