-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamped package #12
Comments
Interesting.
I believe these (at least the latter; not sure about the former) were only recently added to the HTML spec. I'd love to add support for them to html-encoding-sniffer, following the spec at https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding
Seems reasonable, although I'm not clear on the use case, since AFAIK all browsers use 1024.
This is not broken; it's following the spec: https://html.spec.whatwg.org/multipage/parsing.html#prescan-a-byte-stream-to-determine-its-encoding step 4.case2.15.
I'm hesitant to add the complexity of streams (especially Node streams) to this package, so this would require some extra discussion as to how we could layer the API into a non-streaming version and a streaming version. |
|
To be clearer about what I'm proposing: I would like https://github.com/fb55/encoding-sniffer to become |
Ah, I see, thanks.
Oh, sorry, no, I am not interested in that. I thought you were offering to improve html-encoding-sniffer. |
No worries, thanks for the reply. Just in case the semantic difference matters to you: I am also happy to open a PR that adds the state machine of fb55/encoding-sniffer to this package, and archive my repo. The original wording was supposed to cover both, and I honestly just want to have a package that covers the use-cases I have for cheerio. |
Hi @domenic et al,
I was looking into using this package for
cheerio
, but had several issues that I wanted to fix first. As extending the currenthtml-encoding-sniffer
package turned out to be cumbersome, I opted to write a new module instead:https://github.com/fb55/encoding-sniffer
This new package implements the current version of the encoding sniffing algo as a state machine. That allows streams to be supported without much effort. Features this supports, which aren't present in
html-encoding-sniffer
:<?xml encoding="...">
)x-user-defined
in<meta>
tags (turns outhtml-encoding-sniffer
's support is broken)I would love to join forces and have a single package that both jsdom and cheerio can use going forward. Let me know if this is something you'd be interested in!
The text was updated successfully, but these errors were encountered: