fix: strip markdown markers and table pipes from text-to-speech - #31
Merged
Conversation
The Speak buttons fed raw model.output to AVSpeechSynthesizer, so it vocalized table pipes/delimiter rows and inline markers (**, *, `, #, -, links) literally. Add ResultSegment.spokenText(_:) — a speech-friendly projection that reuses the table parser (so the `| --- |` delimiter row is already dropped) to read table cells as comma-separated values, and strips inline/block markdown markers from the rest. Plain text without markup is returned unchanged. Both the input and result Speak buttons now route through it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 14, 2026
Merged
iuhoay
added a commit
that referenced
this pull request
Jun 15, 2026
Bump MARKETING_VERSION / CFBundleShortVersionString to 0.2.0 and move the CHANGELOG [Unreleased] section into a dated [0.2.0] entry. Adds the previously-unlisted auto-resize window feature (#34) and the TTS markdown stripping fix (#31) to the notes. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The Speak buttons passed raw
model.output(andmodel.inputText) straight toAVSpeechSynthesizer, so it read markdown out loud literally — table pipes and the| --- |delimiter row, plus**,*,`,#, list bullets, and link URLs. Now that results commonly contain tables, this was noticeable.How
ResultSegment.spokenText(_:)— a speech-friendly plain-text projection:**/__/*/`/~~) are removed;[text](url)/unwrap to their label.#, blockquote>, ordered/unordered list bullets) and thematic breaks (---) are stripped.TranslationView).Testing
xcodebuild ... testgreen — 97 tests / 14 suites, including a newSpokenTextTestssuite (7 tests): inline markers, link/image unwrap, block prefixes, thematic breaks, and tables (asserting no|or---survive and cells join as expected).Closes the TTS gap noted in #30.
🤖 Generated with Claude Code