Skip to content

HTML5Parser has incorrect behavior #558

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

Closed
theRealProHacker opened this issue Feb 20, 2023 · 1 comment · Fixed by #559
Closed

HTML5Parser has incorrect behavior #558

theRealProHacker opened this issue Feb 20, 2023 · 1 comment · Fixed by #559

Comments

@theRealProHacker
Copy link
Contributor

On Version 1.1

The doc strings give this example, which would be great, if it worked, but actually it fails when tree = "lxml"

def __init__(self, tree=None, strict=False, namespaceHTMLElements=True, debug=False):
        """
        :arg tree: a treebuilder class controlling the type of tree that will be
            returned. Built in treebuilders can be accessed through
            html5lib.treebuilders.getTreeBuilder(treeType)

        :arg strict: raise an exception when a parse error is encountered

        :arg namespaceHTMLElements: whether or not to namespace HTML elements

        :arg debug: whether or not to enable debug mode which logs things

        Example:

        >>> from html5lib.html5parser import HTMLParser
        >>> parser = HTMLParser()                     # generates parser with etree builder
        >>> parser = HTMLParser('lxml', strict=True)  # generates parser with lxml builder which is strict

        """
@theRealProHacker
Copy link
Contributor Author

Update: This is a duplicate of #513, but I would still like to merge the PR and then close this issue and #513

@ambv ambv closed this as completed in #559 Mar 1, 2023
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

Successfully merging a pull request may close this issue.

1 participant