Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial fix for URLs with localhost:port #148

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

lionel-rowe
Copy link

Partially fixes #119

  • Fixed: localhost:port URLs are now correctly delimited and no longer cause malformed HTML when passing existing <a> tags through anchorme
  • Not fixed: host and port metadata are still missing from list results. This also applies to non-Latin-text URLs such as http://www.عربي.com and is due to the confirmedByProtocol regex fragment not capturing those parts. Might be worth fixing at some stage, but for now that metadata is simply missing for those types of URL (which is compatible with the TypeScript definitions). In any case, consumers in environments that support the native URL constructor can just use that to parse the URLs if needed:
    const url = anchorme.list('http://localhost:8888')[0]
    url.port // undefined
    new URL(url.string).port // '8888'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Urls with localhost:port number will not work
1 participant