Example usage for org.apache.commons.lang3 StringEscapeUtils unescapeHtml4

List of usage examples for org.apache.commons.lang3 StringEscapeUtils unescapeHtml4

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringEscapeUtils unescapeHtml4.

Prototype

public static final String unescapeHtml4(final String input) 

Source Link

Document

Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

Usage

From source file:com.ibm.watson.catalyst.qa.safe.strings.QaSafeStrings.java

/**
 * Decodes HTML encoded text//from w w w .  j  a  va2  s  .c o  m
 * @param aString the string to replace decimal code points in
 * @return the string with the decimal code points replaced
 */
public static String unescapeHtml4(final String aString) {
    return StringEscapeUtils.unescapeHtml4(aString);
}

From source file:ch.ifocusit.livingdoc.plugin.utils.AsciidocUtil.java

public static Optional<String> getTitle(Asciidoctor asciidoctor, String pageContent) {
    return Optional.ofNullable(asciidoctor.readDocumentHeader(pageContent).getDocumentTitle())
            .map(title -> StringEscapeUtils.unescapeHtml4(title.getMain()));
}

From source file:net.dv8tion.discord.util.SearchResult.java

private static String cleanString(String uncleanString) {
    return StringEscapeUtils.unescapeJava(StringEscapeUtils.unescapeHtml4(
            uncleanString.replaceAll("\\s+", " ").replaceAll("\\<.*?>", "").replaceAll("\"", "")));
}

From source file:de.wbuecke.codec.HtmlInput.java

@Override
public String decode(String input) {
    return StringEscapeUtils.unescapeHtml4(input);
}

From source file:com.wellsandwhistles.android.redditsp.reddit.prepared.RedditParsedComment.java

public RedditParsedComment(final RedditComment comment) {

    mSrc = comment;//from www . j  av  a2  s  .co m

    mBody = MarkdownParser.parse(StringEscapeUtils.unescapeHtml4(comment.body).toCharArray());
    if (comment.author_flair_text != null) {
        mFlair = StringEscapeUtils.unescapeHtml4(comment.author_flair_text);
    } else {
        mFlair = null;
    }
}

From source file:fredboat.command.fun.TalkCommand.java

public static void talk(Member member, TextChannel channel, String question) {
    //Clerverbot integration
    String response = FredBoat.jca.getResponse(question);
    response = member.getEffectiveName() + ": " + StringEscapeUtils.unescapeHtml4(response);
    channel.sendMessage(response).queue();
}

From source file:com.yilang.commons.utils.util.Encodes.java

public static String unescapeHtml(String htmlEscaped) {
    return StringEscapeUtils.unescapeHtml4(htmlEscaped);
}

From source file:automation.Launcher.java

public static String cleanHTML(String html) {
    String result = br2nl(html);/*  ww  w.  ja  va 2 s  .c  o m*/
    result = StringEscapeUtils.unescapeHtml4(result);
    result = result.replaceAll("(?s)<!--.*?-->", "");
    return result;
}

From source file:eu.europeana.querylog.clean.HTMLCleaner.java

@Override
public String clean(String query) {
    query = StringEscapeUtils.unescapeHtml4(query);
    try {/*from   w  w w.ja va2  s .c  o m*/
        query = URLDecoder.decode(query, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        logger.debug("error trying to convert the text from javascript to string");
    } catch (IllegalArgumentException e) {
        logger.debug("error trying to convert the text from javascript to string");
    }
    return query;

}

From source file:io.github.karols.hocr4j.dom.HocrText.java

/**
 * Creates a text node with given text
 * @param t HTML-encoded text
 */
public HocrText(String t) {
    text = StringEscapeUtils.unescapeHtml4(t);
}