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.hj.blog.common.utils.StringUtils.java

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

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

public RedditParsedPost(final RedditPost src, final boolean parseSelfText) {

    this.mSrc = src;

    if (src.title == null) {
        mTitle = "[null]";
    } else {/*w  ww . jav a  2 s.  c o m*/
        mTitle = StringEscapeUtils.unescapeHtml4(src.title.replace('\n', ' ')).trim();
    }

    mUrl = StringEscapeUtils.unescapeHtml4(src.url);
    mPermalink = StringEscapeUtils.unescapeHtml4(src.permalink);

    if (parseSelfText && src.is_self && src.selftext != null && src.selftext.trim().length() > 0) {
        mSelfText = MarkdownParser.parse(StringEscapeUtils.unescapeHtml4(src.selftext).toCharArray());
    } else {
        mSelfText = null;
    }

    if (src.link_flair_text != null && src.link_flair_text.length() > 0) {
        mFlairText = StringEscapeUtils.unescapeHtml4(src.link_flair_text);
    } else {
        mFlairText = null;
    }
}

From source file:com.tc.utils.StrUtils.java

public static String removeHtml(String source) {
    String scrubbed = source.replaceAll("<[^>]*>", StringCache.EMPTY).replaceAll("&nbsp;", StringCache.EMPTY);
    return StringEscapeUtils.unescapeHtml4(scrubbed);
}

From source file:com.oakhole.utils.StringUtils.java

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

From source file:com.wellsandwhistles.android.redditsp.fragments.PostPropertiesDialog.java

@Override
protected void prepare(AppCompatActivity context, LinearLayout items) {

    final RedditPost post = getArguments().getParcelable("post");

    items.addView(/*w w w  .ja v a2  s .  c o  m*/
            propView(context, R.string.props_title, StringEscapeUtils.unescapeHtml4(post.title.trim()), true));
    items.addView(propView(context, R.string.props_author, post.author, false));
    items.addView(propView(context, R.string.props_url, StringEscapeUtils.unescapeHtml4(post.url), false));
    items.addView(propView(context, R.string.props_created,
            SRTime.formatDateTime(post.created_utc * 1000, context), false));

    if (post.edited instanceof Long) {
        items.addView(propView(context, R.string.props_edited,
                SRTime.formatDateTime((Long) post.edited * 1000, context), false));
    } else {
        items.addView(propView(context, R.string.props_edited, R.string.props_never, false));
    }

    items.addView(propView(context, R.string.props_subreddit, post.subreddit, false));
    items.addView(propView(context, R.string.props_score, String.valueOf(post.score), false));
    items.addView(propView(context, R.string.props_num_comments, String.valueOf(post.num_comments), false));

    if (post.selftext != null && post.selftext.length() > 0) {
        items.addView(propView(context, R.string.props_self_markdown,
                StringEscapeUtils.unescapeHtml4(post.selftext), false));
    }
}

From source file:baggage.guerilla.TextItem.java

@Override
public String getStringValue() {
    return StringEscapeUtils.unescapeHtml4(value);
}

From source file:apm.common.utils.Encodes.java

/**
 * Html ?.
 */
public static String unescapeHtml(String htmlEscaped) {
    return StringEscapeUtils.unescapeHtml4(htmlEscaped);
}

From source file:com.cognifide.qa.bb.aem.dialog.classic.field.AemRadioOption.java

/**
 * Replace html entities to unicode characters e.g. &nbsp; to space character
 *
 * @param text//from  w  ww  .  j  a  v  a 2s  .  c om
 * @return String after replacement
 */
private static String getUnescapedText(String text) {
    return StringEscapeUtils.unescapeHtml4(text);
}

From source file:com.eryansky.common.utils.encode.EncodeUtils.java

/**
 * Html ?.
 */
public static String htmlUnescape(String htmlEscaped) {
    return StringEscapeUtils.unescapeHtml4(htmlEscaped);
}

From source file:$.Encodes.java

/**
     * Html ?.
     */
    public static String unescapeHtml(String htmlEscaped) {
        return StringEscapeUtils.unescapeHtml4(htmlEscaped);
    }