markdown-it / linkify-it

Links recognition library with full unicode support
http://markdown-it.github.io/linkify-it/
MIT License
655 stars 63 forks source link

Inconsistent link recognition when wrapped within html element #90

Closed benkeen closed 4 years ago

benkeen commented 4 years ago

Great library. However, I ran into a small issue & I don't think it's a configuration problem on my end.

When running linkify on each of these two lines, it's able to find the link in the first one but not the second. I haven't disabled the fuzzy option.

<div>http://google.com</div>
<div>google.com</div>

Removing the wrapper <div> elements makes the script find the links on both lines.

puzrin commented 4 years ago

This linkifier is not magical thing to understand any possible input format. It search links in human-readable texts only. If you use html - you shold parse it and apply linkifier to every text component.

benkeen commented 4 years ago

Thanks for the response. :)