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

Add extractSpans method so that we can deprecate renderLinks (#21) #25

Closed robinst closed 6 years ago

robinst commented 6 years ago

With spans, the code for renderLinks can just be written as a normal loop with an if statement. This makes it possible to render the text between links in a special way too (e.g. escape it).

@mindhaq have a look at this (probably mostly the changed example in the README).