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

Commit 7a723dc

Browse files
committed
Allow schemes to appear as domain prefixes
This allows schemes to additionally appear at the start of a domain, such as: * http.org * http-help.org * http123.org
1 parent 99344d4 commit 7a723dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/linkifyjs/src/core/parser.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ export function init() {
109109
makeT(DomainDotTld, tk.HYPHEN, DomainHyphen);
110110
makeMultiT(DomainDotTld, tk.domain, Domain);
111111

112+
// Schemes can also appear at the start of a domain name as well
113+
makeT(Scheme, tk.DOT, DomainDot);
114+
makeT(Scheme, tk.HYPHEN, DomainHyphen);
115+
makeMultiT(Scheme, tk.domain, Domain);
116+
112117
// Become real URLs after `SLASH` or `COLON NUM SLASH`
113118
// Here works with or without scheme:// prefix
114119
makeT(DomainDotTld, tk.COLON, DomainDotTldColon);

0 commit comments

Comments
 (0)