Skip to content

A Java library to detect URLs in plain-text strings and convert them to HTML anchor tags. Inspired by linkifyjs.

License

Notifications You must be signed in to change notification settings

barbarysoftware/Linkifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linkifier

A Java library to detect URLs in plain-text strings and convert them to HTML anchor tags.

Inspired by linkifyjs.

  • Extremely light
  • Zero dependencies
  • 100% test coverage
  • Simple to use: Input is a Java String, output is a Java String.

Linkifier has not yet reached version 1. The basic API is likely to change somewhat before we settle on version 1.

Linkifier is maintained by the dev team at Feature Upvote.

Example

    public static void main(String[] args) {
        String input = "Many websites use example.com in their docs";
        var linkified = new Linkifier().linkify(input);
        System.out.println(linkified);
        // Output: Many websites use <a href='http://example.com' target='_blank'>example.com</a> in their docs
    }

About

A Java library to detect URLs in plain-text strings and convert them to HTML anchor tags. Inspired by linkifyjs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages