robinst / autolink-java

Java library to extract links (URLs, email addresses) from plain text; fast, small and smart
MIT License
207 stars 40 forks source link

Do not insert HtmlTag when there is already a tag #31

Closed xSkip closed 5 years ago

xSkip commented 5 years ago

When the input Text is already proper formated as a Html Link

eg. input= "wow, so example: <a href="http://test.com">http://test.com</a>"

The output would be: wow, so example: <a href="<a href="http://test.com">http://test.com</a>"><a href="http://test.com">http://test.com</a></a>

It would be great, when it detects already proper formated Html Links and don't append the tags in this case.

robinst commented 5 years ago

That would be handy, but it would mean depending on an HTML parser and renderer library. But I want to keep this library small and focused on the goal of finding links within plain text. I added a section with an explanation about this to the README:

https://github.com/robinst/autolink-java#what-this-is-not