From 2bd54ac23687c03484dc25018debb663af636f01 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Fri, 27 Feb 2026 13:46:27 +0800 Subject: [PATCH] fix(tts): also show highlight when navigating in paused mode and improve abbreviations processing (#3396) Closes #3317. --- apps/readest-app/src/services/tts/TTSController.ts | 11 ++++++++++- packages/foliate-js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/readest-app/src/services/tts/TTSController.ts b/apps/readest-app/src/services/tts/TTSController.ts index f1557ed3..99f6d64a 100644 --- a/apps/readest-app/src/services/tts/TTSController.ts +++ b/apps/readest-app/src/services/tts/TTSController.ts @@ -213,7 +213,16 @@ export class TTSController extends EventTarget { } async #handleNavigationWithSSML(ssml: string | undefined, isPlaying: boolean) { - if (isPlaying) this.#speak(ssml); + if (isPlaying) { + this.#speak(ssml); + } else { + if (ssml) { + const { marks } = parseSSMLMarks(ssml); + if (marks.length > 0) { + this.dispatchSpeakMark(marks[0]); + } + } + } } async #handleNavigationWithoutSSML(initSection: () => Promise, isPlaying: boolean) { diff --git a/packages/foliate-js b/packages/foliate-js index 53a91489..544a867a 160000 --- a/packages/foliate-js +++ b/packages/foliate-js @@ -1 +1 @@ -Subproject commit 53a914894a21b8509955cd50cd678b4d25468e17 +Subproject commit 544a867a4d89aecdaa79942a1b4a4681c7d5295a