Skip to content

Commit 975b1b2

Browse files
authored
fix: collapse newlines before TTS to prevent mid-chapter pauses
1 parent 9c21ca9 commit 975b1b2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ <h3 id="panel-heading">Contents</h3>
15381538
? ch.text.slice(state.charOffset)
15391539
: ch.text;
15401540

1541-
const utter = new SpeechSynthesisUtterance(text);
1541+
const utter = new SpeechSynthesisUtterance(text.replace(/\n+/g, ' '));
15421542
utter.rate = state.speed;
15431543
if (state.voice) utter.voice = state.voice;
15441544
state.wordIndex = 0;

0 commit comments

Comments
 (0)