|
|
@ -59,17 +59,17 @@ object HtmlFormatter { |
|
|
|
|
|
|
|
|
|
|
|
do{ |
|
|
|
do{ |
|
|
|
val url = matcher.group(1)!! |
|
|
|
val url = matcher.group(1)!! |
|
|
|
val pos = url.indexOf(',') |
|
|
|
val urlBefore = url.substringBefore(',') |
|
|
|
val beforeStr = keepImgHtml.substring(appendPos, matcher.start()) |
|
|
|
val beforeStr = keepImgHtml.substring(appendPos, matcher.start()) |
|
|
|
sb.append( if(beforeStr == "\n") '\n' else beforeStr.replace("\n","\n ") ) //缩进换行下个非图片段落 |
|
|
|
sb.append( if(beforeStr == "\n") '\n' else beforeStr.replace("\n","\n ") ) //缩进换行下个非图片段落 |
|
|
|
sb.append( |
|
|
|
sb.append( |
|
|
|
"<img src=\"${ |
|
|
|
"<img src=\"${ |
|
|
|
NetworkUtils.getAbsoluteURL( |
|
|
|
NetworkUtils.getAbsoluteURL( |
|
|
|
redirectUrl, |
|
|
|
redirectUrl, |
|
|
|
url.substring(0, pos) |
|
|
|
urlBefore |
|
|
|
) |
|
|
|
) |
|
|
|
},${ |
|
|
|
}${ |
|
|
|
url.substring(pos + 1 ) |
|
|
|
url.substring(urlBefore.length) |
|
|
|
}\">" |
|
|
|
}\">" |
|
|
|
) |
|
|
|
) |
|
|
|
appendPos = matcher.end() |
|
|
|
appendPos = matcher.end() |
|
|
@ -79,7 +79,8 @@ object HtmlFormatter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (appendPos < keepImgHtml.length) { |
|
|
|
if (appendPos < keepImgHtml.length) { |
|
|
|
sb.append(keepImgHtml.substring(appendPos, keepImgHtml.length).replace("\n","\n ")) //非图片部分换行缩减 |
|
|
|
val beforeStr = keepImgHtml.substring(appendPos, keepImgHtml.length) |
|
|
|
|
|
|
|
sb.append( if(beforeStr == "\n") '\n' else beforeStr.replace("\n","\n ") ) //缩进换行下个非图片段落 |
|
|
|
} |
|
|
|
} |
|
|
|
return sb.toString() |
|
|
|
return sb.toString() |
|
|
|
} |
|
|
|
} |
|
|
|