Open haugstrup opened 4 years ago
Have the same problem
I have the same problem, links with underscores break into multiple parts.
http://faq_for_users.domain.com -> converts into three parts, (faq
and users.domain.com
like links, and _for_
like plain text);
@gregjacobs Do you have any idea how to fix this problem? Maybe you can point out the origin of this problem.
@haugstrup Have you invented a workaround? Can you share it?
Hey, just wanted to point out that this PR should address this issue. So if possible, @gregjacobs could review and merge it. Thank you.
This is related to #277 in that it's an issue with
getDomainNameStr
inregex-lib.ts
.Subdomain names are treated pretty lax out in the wild. It's common to see subdomains with underscores, but autolinker won't identify these links.
For example:
http://_foo.example.com
will identifyfoo.example.com
as the link. Andhttp://foo_bar.example.com
will identify two links (http://foo
andbar.example.com
).@gregjacobs Do you have any general hints on how to target subdomains separately from the normal domain name in
getDomainNameStr
? I can make the changes and write tests, but I'm having some trouble parsing the current logic.