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:
parent
7cd1210814
commit
ec42be9402
|
@ -1,7 +1,13 @@
|
||||||
<ReleaseNotes>
|
<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"
|
<Changeset component="org.gcube.socialnetworking.social-util-library.1-1-0"
|
||||||
date="2017-04-13">
|
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>
|
||||||
<Changeset component="org.gcube.socialnetworking.social-util-library.1-0-1"
|
<Changeset component="org.gcube.socialnetworking.social-util-library.1-0-1"
|
||||||
date="2016-10-01">
|
date="2016-10-01">
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.socialnetworking</groupId>
|
<groupId>org.gcube.socialnetworking</groupId>
|
||||||
<artifactId>social-util-library</artifactId>
|
<artifactId>social-util-library</artifactId>
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.2.0-SNAPSHOT</version>
|
||||||
<name>social-util-library</name>
|
<name>social-util-library</name>
|
||||||
<description>
|
<description>
|
||||||
The social-util-library contains utility functions that can be used by the social-networking portlets.
|
The social-util-library contains utility functions that can be used by the social-networking portlets.
|
||||||
|
|
|
@ -352,4 +352,18 @@ public class Utils {
|
||||||
description = ((description.length() > 256) ? description.substring(0, 256)+"..." : description);
|
description = ((description.length() > 256) ? description.substring(0, 256)+"..." : description);
|
||||||
return 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("\\<[^>]*>","");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue