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

What about html(5?) support? #10

Open
wilzbach opened this issue Jan 28, 2018 · 6 comments
Open

What about html(5?) support? #10

wilzbach opened this issue Jan 28, 2018 · 6 comments

Comments

@wilzbach
Copy link
Member

From @trikko on August 1, 2016 7:28

I wonder if it is too difficult to support also html 5. IMO it would be a good idea for web-related applications.

Copied from original issue: lodo1995/experimental.xml#28

@wilzbach
Copy link
Member Author

From @Hackerpilot on August 1, 2016 8:15

HTML is not XML. I don't think this is a reasonable feature request.

For further information about the madness that HTML supports, check out the spec here: https://www.w3.org/TR/html5/syntax.html#tree-construction. Note the gigantic state machine specified for parsing malformed tags.

@wilzbach
Copy link
Member Author

From @Hackerpilot on August 1, 2016 8:17

Of course if your HTML input also happens to be XHTML, then there shouldn't be a problem.

@wilzbach
Copy link
Member Author

From @trikko on August 1, 2016 8:17

I know it's not the same. But maybe at least XHTML 5 could be interesting.

@wilzbach
Copy link
Member Author

From @trikko on August 1, 2016 8:21

(anyway: I don't care too much about parsing malformed html and fixing it. It would be interesting to have dom-related function for tree manipulation and output valid html5)

@wilzbach
Copy link
Member Author

From @rjmcguire on August 1, 2016 8:54

On Mon, Aug 1, 2016 at 10:21 AM, Andrea Fontana [email protected]
wrote:

(anyway: I don't care too much about parsing malformed html and fixing it.
It would be interesting to have dom-related function for tree manipulation
and output valid html5)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
lodo1995/experimental.xml#28 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABU8CWLeIdIsjOyesHN-ncxPxfkg27WZks5qbayPgaJpZM4JZURI
.

+1, I think it would be irresponsible to allow the definitive standard xml
parser to fix dodgy html / xml. There are tools for that.
How hard it is to do html5 parsing / output with the standard library will
be important to validate during experimental phase of this library though.

@wilzbach
Copy link
Member Author

From @lodo1995 on August 1, 2016 12:15

@trikko as @Hackerpilot said, it's not possible to parse all HTML with an XML parser. The idea is to keep the components of the library as independent and generic as possible. So, for example, the parser and cursor do not check for correct element nesting. The parser doesn't even need to parse attributes. So this library already provides some building blocks to parse HTML.
If your HTML happens to be XHTML, then you can even use this library to build a DOM. You can use the provided DOM implementation, which will have full Level 3 support. Or you can create a custom DOM hierarchy with advanced HTML/SVG/whatever-you-need support, basing it on the provided one, and then have the provided DOMBuilder build it.

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

1 participant