@ -127,15 +127,22 @@ public class HtmlHelper {
static String autolink ( String text ) {
static String autolink ( String text ) {
Matcher matcher = pattern . matcher ( text ) ;
Matcher matcher = pattern . matcher ( text ) ;
StringBuffer sb = new StringBuffer ( ) ;
StringBuilder sb = new StringBuilder ( ) ;
int end = 0 ;
while ( matcher . find ( ) ) {
while ( matcher . find ( ) ) {
String ref = matcher . group ( ) ;
sb . append ( html ( text . substring ( end , matcher . start ( ) ) ) ) ;
matcher . appendReplacement ( sb , String . format ( "<a href=\"%s\">%s</a>" , ref , ref ) ) ;
String ref = html ( matcher . group ( ) ) ;
sb . append ( String . format ( "<a href=\"%s\">%s</a>" , ref , ref ) ) ;
end = matcher . end ( ) ;
}
}
matcher . appendTail ( sb ) ;
sb. append ( text . substring ( end ) ) ;
return sb . toString ( ) ;
return sb . toString ( ) ;
}
}
private static String html ( String plain ) {
return plain . replace ( "&" , "&" ) . replace ( "<" , "<" ) ;
}
static Drawable decodeImage ( String source , Context context , long id , boolean show ) {
static Drawable decodeImage ( String source , Context context , long id , boolean show ) {
int px = Helper . dp2pixels ( context , 48 ) ;
int px = Helper . dp2pixels ( context , 48 ) ;