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

Possible bug parsing DOCTYPE of 4.01 Transitional HTML document #36

Open
langdonr621 opened this issue Feb 21, 2024 · 0 comments
Open

Comments

@langdonr621
Copy link

hi there,

i'm trying to use your library (0.7.0) but am facing a problem when parsing, for example, https://www.unicode.org/reports/tr29/#Word_Boundaries. the error thrown is similar to:

running 1 test
Failed :(  --> 1:23
 |
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 |                       ^---
 |
 = expected attribute key

here's a test function showing the problem:

    #[test]
    fn test_html_parser() {
        const HTML: &str = r#"<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html></html>"#;

        if let Err(x) = html_parser::Dom::parse(HTML) {
            println!("Failed :( {}", x)
        }
    }

this wikipedia page claims the directive's syntax is correct.

am i correct in assuming this is a bug with the grammar's rules used?

if not would appreciate it if you can indicate a work-around.

TIA + cheers;

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