Epub tts fix (#103)
* build: bump version to 1.0.38 and improve CFI page lookup logic * fix: resolve duplicate TTS audio and broken highlights in Vertical Mode Updated the text extraction logic in epub_reader.js to pick only the most granular matching elements, preventing duplication when elements like <p> are nested inside <li>.
This commit is contained in:
parent
fbe8e7aa56
commit
32e29dfc07
5 changed files with 44 additions and 24 deletions
|
|
@ -131,6 +131,7 @@ class TtsJsBridge(
|
|||
) {
|
||||
@JavascriptInterface
|
||||
fun onStructuredTextExtracted(json: String) {
|
||||
Timber.tag("TTS_LIST_DIAG").d("Bridge received JSON: $json")
|
||||
if (json.isNotBlank() && json != "[]") {
|
||||
scope.launch {
|
||||
ttsStructuredTextHandler(json)
|
||||
|
|
@ -545,6 +546,10 @@ fun ChapterWebView(
|
|||
.d("JS -> ${message.substringAfter("BookmarkDiagnosis: ")}")
|
||||
}
|
||||
|
||||
message.startsWith("TTS_LIST_DIAG:") -> {
|
||||
Timber.tag("TTS_LIST_DIAG").d("JS -> ${message.substringAfter("TTS_LIST_DIAG: ")}")
|
||||
}
|
||||
|
||||
message.startsWith("CFI_DIAGNOSIS:") -> {
|
||||
Timber.d(
|
||||
"JS -> ${message.substringAfter("CFI_DIAGNOSIS: ")}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue