|
|
@ -60,8 +60,7 @@ object HtmlFormatter { |
|
|
|
do{ |
|
|
|
do{ |
|
|
|
val url = matcher.group(1)!! |
|
|
|
val url = matcher.group(1)!! |
|
|
|
val urlBefore = url.substringBefore(',') |
|
|
|
val urlBefore = url.substringBefore(',') |
|
|
|
val beforeStr = keepImgHtml.substring(appendPos, matcher.start()) |
|
|
|
sb.append( keepImgHtml.substring(appendPos, matcher.start()).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( |
|
|
@ -79,8 +78,7 @@ object HtmlFormatter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (appendPos < keepImgHtml.length) { |
|
|
|
if (appendPos < keepImgHtml.length) { |
|
|
|
val beforeStr = keepImgHtml.substring(appendPos, keepImgHtml.length) |
|
|
|
sb.append( keepImgHtml.substring( appendPos, keepImgHtml.length ).replace("\n","\n ") ) //缩进换行下个非图片段落 |
|
|
|
sb.append( if(beforeStr == "\n") '\n' else beforeStr.replace("\n","\n ") ) //缩进换行下个非图片段落 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return sb.toString() |
|
|
|
return sb.toString() |
|
|
|
} |
|
|
|
} |
|
|
|