added method to remove html tags

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/social-networking/social-util-library@148716 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-05-16 14:04:17 +00:00
parent 7cd1210814
commit ec42be9402
3 changed files with 22 additions and 2 deletions

View File

@ -1,7 +1,13 @@
<ReleaseNotes>
<Changeset component="org.gcube.socialnetworking.social-util-library.1-2-0"
date="2017-04-13">
<Change>Added method to remove html tags from a text (useful for #247)
</Change>
</Changeset>
<Changeset component="org.gcube.socialnetworking.social-util-library.1-1-0"
date="2017-04-13">
<Change>Bug #8063, Share Updates links are truncated in some cases</Change>
<Change>Bug #8063, Share Updates links are truncated in some cases
</Change>
</Changeset>
<Changeset component="org.gcube.socialnetworking.social-util-library.1-0-1"
date="2016-10-01">

View File

@ -10,7 +10,7 @@
<groupId>org.gcube.socialnetworking</groupId>
<artifactId>social-util-library</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
<name>social-util-library</name>
<description>
The social-util-library contains utility functions that can be used by the social-networking portlets.

View File

@ -352,4 +352,18 @@ public class Utils {
description = ((description.length() > 256) ? description.substring(0, 256)+"..." : description);
return description;
}
/**
* Remove HTML tags from text by using the following '\\<[^>]*>"'
* @param text
* @return a String without html tags
*/
public static String removeHTMLFromText(String text){
if(text == null)
return null;
else
return text.replaceAll("\\<[^>]*>","");
}
}