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

wrong parse of <div\n #5

Closed
wvermin opened this issue Aug 21, 2022 · 2 comments
Closed

wrong parse of <div\n #5

wvermin opened this issue Aug 21, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@wvermin
Copy link

wvermin commented Aug 21, 2022

Hi,

I like to report a bug in html_editor.
Running this program:

use html_editor::parse;
fn main() {
    let s = r#"
<div
> </div>
"#;

   let dom = parse(&s);
   println!("wrong: {:?}",dom);

    let s = r#"
<div> </div>
"#;
   let dom = parse(&s);
   println!("good: {:?}",dom);
}

I get:

wrong: Err("<div\n> does not match the </div>")
good: Ok([Text("\n"), Element { name: "div", attrs: [], children: [Text(" ")] }, Text("\n")])

So, it seems that html_editor does not handle a newline as a space or tab where it should.
The example is with <div>, but the bug affects also other tags like <a>.

Regards, and thanks for the package,

Willem

@lomirus lomirus added the bug Something isn't working label Aug 21, 2022
@lomirus lomirus self-assigned this Aug 21, 2022
@lomirus
Copy link
Owner

lomirus commented Aug 21, 2022

Hi, Willem! Thanks for your reporting. I just fixed it in v0.5.2 and you can check it out.

@lomirus lomirus closed this as completed Aug 21, 2022
@wvermin
Copy link
Author

wvermin commented Aug 21, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants