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

non-breaking space is included as part of e-mail links #66

Open
hamamo opened this issue Sep 8, 2023 · 0 comments
Open

non-breaking space is included as part of e-mail links #66

hamamo opened this issue Sep 8, 2023 · 0 comments

Comments

@hamamo
Copy link

hamamo commented Sep 8, 2023

Apparently "\u{a0}" is considered part of e-mail links, as shown by this failing test case:

#[test]
fn test_link_finder() {
    let text =
        "this is a mail address:\u{a0}test@example.com\u{a0}surrounded by non-breaking spaces";
    let mut links = LinkFinder::new().links(text);
    assert_eq!(links.next().unwrap().as_str(), "test@example.com");
}

As non-breaking spaces are common in e-mail bodies, this leads to misidentification of links.

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