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

Bug: parse 'DOCTYPE' fail.(v0.6.3 is success v0.7.0 is fail) #30

Open
zhuxiujia opened this issue Jun 17, 2023 · 1 comment
Open

Bug: parse 'DOCTYPE' fail.(v0.6.3 is success v0.7.0 is fail) #30

zhuxiujia opened this issue Jun 17, 2023 · 1 comment

Comments

@zhuxiujia
Copy link

let html=r#"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd">
<mapper>
    <insert id="insert">
        'insert into biz_activity'
        <foreach collection="arg" index="key" item="item" open="(" close=")" separator=",">
            '${key}'
        </foreach>
        'values'
        <foreach collection="arg" index="key" item="item" open="(" close=")" separator=",">
            '${item}'
        </foreach>
    </insert></mapper>"#;
let dom = Dom::parse(html).unwrap();
called `Result::unwrap()` on an `Err` value: Parsing(" --> 1:23\n  |\n1 | <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd\">\n  |                       ^---\n  |\n  = expected attribute key")
thread 'test::test_parser' panicked at 'called `Result::unwrap()` on an `Err` value: Parsing(" --> 1:23\n  |\n1 | <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd\">\n  |                       ^---\n  |\n  = expected attribute key")', tests\loader_html.rs:18:27
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library\std\src\panicking.rs:593
   1: core::panicking::panic_fmt
             at /rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library\core\src\panicking.rs:67
   2: core::result::unwrap_failed
             at /rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library\core\src\result.rs:1651
   3: enum2$<core::result::Result<alloc::vec::Vec<rbatis_codegen::codegen::loader_html::Element,alloc::alloc::Global>,enum2$<html_parser::error::Error> > >::unwrap<alloc::vec::Vec<rbatis_codegen::codegen::loader_html::Element,alloc::alloc::Global>,enum2$<html_p
             at /rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753\library\core\src\result.rs:1076
   4: loader_html::test::test_parser
             at .\tests\loader_html.rs:7
   5: loader_html::test::test_parser::closure$0
             at .\tests\loader_html.rs:6
   6: core::ops::function::FnOnce::call_once<loader_html::test::test_parser::closure_env$0,tuple$<> >
             at /rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753\library\core\src\ops\function.rs:250
   7: core::ops::function::FnOnce::call_once
             at /rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@zhuxiujia zhuxiujia changed the title Bug: parse fail Bug: parse 'DOCTYPE' fail Jun 17, 2023
@zhuxiujia zhuxiujia changed the title Bug: parse 'DOCTYPE' fail Bug: parse 'DOCTYPE' fail.(v0.6.3 is success v0.7.0 is fail) Jun 17, 2023
@matheusgomes28
Copy link

This is still happening, noticed this when building a web scrapper.

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

2 participants