Links mentions, hashtags, etc. found in text in a Tent protocol style
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A library to expand shortcuts in a Tent-friendly way.

It is a fork of twitter-text-java.


Java 6 is required. Maven is required to build the library.

tent-text-java is currently in Sonatype's Snapshots repo. Add the following repository to your POM's <repositories> tag:


Add the following dependency to the <dependencies> tag:



The main class you'll interact with is com.moandjiezana.tent.text.Autolink.

Autolink methods

  • autoLinkMentionsAndLists(String): converts mentions (eg. ^mwanji) within a block of text to links (eg. <a href="">mwanji</a>)
  • autoLinkHashtags(String): converts hashtags (eg. #tentdev) within a block of text to links (eg. <a href="">#tentdev</a>)
  • autoLinkURLs(String): converts plain URLs within a block a text into HTML links.
  • autoLink(String): combines all of the above

Autolink configuration

Setters are used to customise Autolink's behaviour.

  • mentionClass: CSS class applied to mentions (default: "username")
  • mentionLinker: a SAM-type that converts a plain mention into a URL (default produces https://<mention>
  • hashtagUrlBase: the root of the URL used for hashtags (default: "")
  • hashtagClass: CSS class applied to hashtags (default: "hashtag")
  • noFollow: if true, rel="nofollow" is added to each link (default: true)