Skip to content

Commit 2d4d05c

Browse files
committed
fix(mobile): keep word spacing after combining marks
Also note the English fallback in the voice input guide.
1 parent 14cdc30 commit 2d4d05c

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎docs/user/composer.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ then confirm to transcribe. Text is inserted where your selection was when
136136
recording started, ready for you to review and edit before sending.
137137

138138
Transcription uses the first language in your iPhone's preferred language list
139-
(Settings > General > Language & Region) that Apple's speech model supports.
139+
(Settings > General > Language & Region) that Apple's speech model supports,
140+
or English if none is supported.
140141

141142
The first use may download Apple's speech model and needs a network connection.
142143
Later transcription works offline for that language. Recordings can be up to five

‎packages/client-runtime/src/voice-input/controller.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ describe("resolveTranscriptCommit", () => {
140140
kind: "commit",
141141
text: "Schön Grüße",
142142
});
143+
144+
const combiningMark = draft({ text: "नमस्ते", selection: { start: 6, end: 6 } });
145+
expect(resolveTranscriptCommit(combiningMark, combiningMark, "दुनिया", "hi-IN")).toMatchObject({
146+
kind: "commit",
147+
text: "नमस्ते दुनिया",
148+
});
143149
});
144150

145151
it("does not add English boundary spaces to CJK or selected inline text", () => {

‎packages/client-runtime/src/voice-input/controller.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function resolveTranscriptCommit(
102102
const right = captured.text[captured.selection.start];
103103
const leftNeedsBoundary =
104104
left !== undefined &&
105-
/[\p{L}\p{N}.!?,:;)\]}'"]/u.test(left) &&
105+
/[\p{L}\p{M}\p{N}.!?,:;)\]}'"]/u.test(left) &&
106106
(right === undefined || /\s/.test(right));
107107
const rightNeedsBoundary =
108108
right !== undefined &&

0 commit comments

Comments
 (0)