diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt index 620b18bc9..69899d87c 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt @@ -149,7 +149,8 @@ data class TextPage( removePageAloudSpan() var lineStart = 0 for ((index, textLine) in textLines.withIndex()) { - if (aloudSpanStart > lineStart && aloudSpanStart < lineStart + textLine.text.length) { + val lineLength = textLine.text.length + if (textLine.isParagraphEnd) 1 else 0 + if (aloudSpanStart > lineStart && aloudSpanStart < lineStart + lineLength) { for (i in index - 1 downTo 0) { if (textLines[i].isParagraphEnd) { break @@ -167,7 +168,7 @@ data class TextPage( } break } - lineStart += textLine.text.length + lineStart += lineLength } }