Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/linkifyjs/src/parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export function init({ groups }) {

// Hyphen can jump back to a domain name
const EmailDomainHyphen = tt(EmailDomain, tk.HYPHEN); // parsed string starts with local email info + @ with a potential domain name
tt(EmailDomainHyphen, tk.HYPHEN, EmailDomainHyphen);
ta(EmailDomainHyphen, groups.domain, EmailDomain);
ta(Email, groups.domain, EmailDomain);
tt(Email, tk.DOT, EmailDomainDot);
Expand All @@ -157,6 +158,7 @@ export function init({ groups }) {
// (but not TLDs)
const DomainHyphen = tt(Domain, tk.HYPHEN); // domain followed by hyphen
const DomainDot = tt(Domain, tk.DOT); // domain followed by DOT
tt(DomainHyphen, tk.HYPHEN, DomainHyphen);
ta(DomainHyphen, groups.domain, Domain);
ta(DomainDot, localpartAccepting, Localpart);
ta(DomainDot, groups.domain, Domain);
Expand Down
2 changes: 2 additions & 0 deletions test/spec/linkifyjs/parser.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ const tests = [
['https://google.com', '\ufffcthis'],
],
['some string with somefile.mp4 token', [Text], ['some string with somefile.mp4 token']],
['hp--community.force.com', [Url], ['hp--community.force.com']],
['[email protected]', [Email], ['[email protected]']],
];

describe('linkifyjs/parser#run()', () => {
Expand Down
Loading