Skip to content

Email address/URL conflict #3

Open
@thewilkybarkid

Description

@thewilkybarkid

I've encountered a case where a URL has been mistyped, and Linkify doesn't cope very well.

Using www.foo@bar.com:

Calling Returns
processEmails() <a href="mailto:www.foo@bar.com">www.foo@bar.com</a>
processUrls() <a href="http://www.foo@bar.com">www.foo@bar.com</a>
process() <a href="http://<a href="mailto:www.foo@bar.com">www.foo@bar.com</a>"><a href="mailto:www.foo@bar.com">www.foo@bar.com</a></a>

In my real-world example, however, there's a path. Using www.foo@bar.com/baz:

Calling Returns
processEmails() <a href="mailto:www.foo@bar.com">www.foo@bar.com</a>/baz
processUrls() <a href="http://www.foo@bar.com/baz">www.foo@bar.com/baz</a>
process() <a href="http://<a href="mailto:www.foo@bar.com">www.foo@bar.com</a>/baz"><a href="mailto:www.foo@bar.com">www.foo@bar.com</a>/baz</a>

Individually processEmails() and processUrls() return acceptable results for both. Combining them (ie process()), results in something very wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions