Skip to content

Mailto links: invalid email address trailing part should not be linkified #522

@vincent-vignaud

Description

@vincent-vignaud

For example, mailto:[email protected]:123 is linkified (linkifyjs/string) as:
<a href="mailto:[email protected]:123" class="linkified">mailto:[email protected]:123</a>.

The value of the href attribute and the value of the text node both contain an invalid email address [email protected]:123.

Since the colon character : is not allowed* in the domain part of the address (unless being an IP address between brackets), the part :123 should not appear in the href attribute nor in the text node.

Same issue with other invalid characters*, for example mailto:[email protected]<123 becomes <a href="mailto:[email protected]<123" class="linkified">mailto:[email protected]&lt;123</a>.

Refs*

Note: great job for this lib by the way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions