Skip to content
Advertisement

How to unescape HTML 5 entities in Java (')

The answers to this question mostly suggest to use apache-common-text StringEscapeUtils. But this (latest version of commons-text is 1.9) only supports HTML 4, and Mastodon appears to use HTML 5 which includes '. How can I decode HTML 5 entities, including '?

Advertisement

Answer

unbescape does the job well:

JavaScript

Result:

JavaScript

Maven:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement