优化链接分割规则,避免 ,{c参数} 的字符串中也存在 ,{ ,导致规则切错

修复<str0,str2,...{{js}}>这种页数列表写法中,js部分内含 < 或 > 就会切割错误的问题

优化格式化图片标签操作和匹配图片标签操作,加快图片处理速度
pull/1118/head
bushixuanqi 3 years ago
parent 715797c69c
commit 6c0b7dcbf4
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt

@ -111,10 +111,10 @@ object ChapterProvider {
)
}
} else {
content.replace(AppPattern.imgPattern.toRegex(), "\n\b\$0\n")
content.replace(AppPattern.imgPattern.toRegex(), "\n\$0\n")
.split("\n").forEach { text ->
if (text.isNotBlank()) {
if(text[0] != '\b'){ //非图片
if(!text.startsWith("<img src=\"")){ //非图片
val isTitle = index == 0
val textPaint = if (isTitle) titlePaint else contentPaint
if (!(isTitle && ReadBookConfig.titleMode == 2)) {
@ -125,7 +125,7 @@ object ChapterProvider {
}
} else { //图片
durY = setTypeImage(
book, bookChapter, text.substring(1),
book, bookChapter, text,
durY, textPages, book.getImageStyle()
)
}

Loading…
Cancel
Save