Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Commit

Permalink
Allow schemes to appear as domain prefixes
Browse files Browse the repository at this point in the history
This allows schemes to additionally appear at the start of a domain, such as:

* http.org
* http-help.org
* http123.org
  • Loading branch information
jryans committed Jan 25, 2022
1 parent 99344d4 commit 7a723dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/linkifyjs/src/core/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export function init() {
makeT(DomainDotTld, tk.HYPHEN, DomainHyphen);
makeMultiT(DomainDotTld, tk.domain, Domain);

// Schemes can also appear at the start of a domain name as well
makeT(Scheme, tk.DOT, DomainDot);
makeT(Scheme, tk.HYPHEN, DomainHyphen);
makeMultiT(Scheme, tk.domain, Domain);

// Become real URLs after `SLASH` or `COLON NUM SLASH`
// Here works with or without scheme:// prefix
makeT(DomainDotTld, tk.COLON, DomainDotTldColon);
Expand Down

0 comments on commit 7a723dc

Please sign in to comment.