修复htmlFormatter错误

pull/1063/head
gedoor 4 years ago
parent 952581db05
commit 7da9ff6912
  1. 2
      app/src/main/java/io/legado/app/constant/AppPattern.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt

@ -9,7 +9,7 @@ object AppPattern {
val EXP_PATTERN: Pattern = Pattern.compile("\\{\\{([\\w\\W]*?)\\}\\}")
//图片有data-开头的数据属性时优先用数据属性作为src,没有数据属性时才匹配src
val imgPattern: Pattern =
Pattern.compile("<img(?:(?![^>]*data-)src|(?=[^>]*data-)[^>]*data-[^= ]+) *= *\"([^\"{]+(?:\\{(?:[^{}]|\\{[^{}]*\\})*\\})?)\"[^>]*>", Pattern.CASE_INSENSITIVE)
Pattern.compile("<img .*?src.*?=.*?\"(.*?(?:,\\{.*\\})?)\".*?>", Pattern.CASE_INSENSITIVE)
val nameRegex = Regex("\\s+作\\s*者.*|\\s+\\S+\\s+著")
val authorRegex = Regex("^.*?作\\s*者[::\\s]*|\\s+著")

@ -118,12 +118,10 @@ object ChapterProvider {
val matcher = AppPattern.imgPattern.matcher(text)
if (matcher.find()) {
matcher.group(1)?.let { src ->
//if (!book.isEpub()) {
durY = setTypeImage(
book, bookChapter, src,
durY, textPages, book.getImageStyle()
)
//}
}
} else {
val isTitle = index == 0

Loading…
Cancel
Save