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

Links containg the same domain not recognized #95

Open
moek opened this issue Sep 18, 2020 · 0 comments
Open

Links containg the same domain not recognized #95

moek opened this issue Sep 18, 2020 · 0 comments

Comments

@moek
Copy link

moek commented Sep 18, 2020

Recently we found a strange behavior with existing links. It looks like anchorme has trouble to recognize links which use the same domain in the url and as a label:

1) recognizes existing link  <a href="https://www.foo.de/lala/">bar.de</a>

2) recognizes existing link too <a href="https://www.foo.de/lala/">www.foo.de/test</a>

a) not working <a href="https://www.foo.de/lala/">foo.de</a>

b) not working either <a href="https://www.foo.de/lala/">www.foo.de</a>
<div id="output" style="white-space: pre-line;">
1) recognizes existing link  <a href="https://www.foo.de/lala/">bar.de</a>

2) recognizes existing link too <a href="https://www.foo.de/lala/">www.foo.de/test</a>

a) not working <a href="https://www.foo.de/lala/"></a><a class="detected" title="[{'start':0,
'end':6,
'string':'foo.de',
'isURL':true,
'host':'foo.de',
'confirmedByProtocol':false}]" href="http://foo.de">foo.de</a>

b) not working either <a href="https://www.foo.de/lala/"></a><a class="detected" title="[{'start':0,
'end':10,
'string':'www.foo.de',
'isURL':true,
'host':'www.foo.de',
'confirmedByProtocol':false}]" href="http://www.foo.de">www.foo.de</a></div>

The only difference between the working and not working examples is the text which is surrounded by the link.

  • It is not working when a text like foo.de is linked with https://www.foo.de/lala/
  • Yet it works fine if we will use a different text, like bar.de.
  • compare 1) vs a) (Same URL in Link but different text)

Thanks for your library it is very convenient to use and very helpful :)

Regards,
moek

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

No branches or pull requests

1 participant