Skip to content
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

[Question] Parsing HTML fragments #323

Closed
lnicola opened this issue Oct 30, 2017 · 1 comment
Closed

[Question] Parsing HTML fragments #323

lnicola opened this issue Oct 30, 2017 · 1 comment

Comments

@lnicola
Copy link
Contributor

lnicola commented Oct 30, 2017

Is there a way to parse some text as a Text node without a body element being automatically created?

See https://play.rust-lang.org/?gist=5632132a9b670f3831a10c931f78c28c&version=stable for an example. I'm interested in a way to have <html>foo</html> and foo parse differently.

@lnicola lnicola changed the title Parsing HTML fragments [Question] Parsing HTML fragments Oct 30, 2017
@Ygg01
Copy link
Contributor

Ygg01 commented Oct 30, 2017

Hi, the thing parse_fragments does is execute this algorithm: https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments If you look at step 1, it's construct an html node.

What you guys needs is something else, I think. Would writing a custom TokenSink, that detects non-text elements work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants