From 796f39fe1fbc7bd97878e7dd11ce1a82639cf4ad Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 8 Nov 2026 01:40:30 +0000 Subject: [PATCH] fix(rtl): write the isolate marks of flowText as escapes, not as raw characters A raw FSI or PDI in the source reads as nothing and is what Sonar's bidirectional character rule (S6389) flags. The strings are the same. --- client/src/utils/flowText.test.ts | 4 ++-- client/src/utils/flowText.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/utils/flowText.test.ts b/client/src/utils/flowText.test.ts index 5abc9c8b6..d826dbdba 100644 --- a/client/src/utils/flowText.test.ts +++ b/client/src/utils/flowText.test.ts @@ -7,8 +7,8 @@ import { afterEach, describe, expect, it } from 'vitest'; import { flowText, isRtlDocument } from './flowText'; -const FSI = '⁨'; -const PDI = '⁩'; +const FSI = '\u2068'; +const PDI = '\u2069'; describe('flowText', () => { afterEach(() => { diff --git a/client/src/utils/flowText.ts b/client/src/utils/flowText.ts index 5da24867c..354157ea9 100644 --- a/client/src/utils/flowText.ts +++ b/client/src/utils/flowText.ts @@ -9,8 +9,8 @@ * script the names are in, and the arrow points left, from the first name to * the second. A left-to-right UI gets the plain string. */ -const FSI = '⁨'; -const PDI = '⁩'; +const FSI = '\u2068'; +const PDI = '\u2069'; export function isRtlDocument(): boolean { return typeof document !== 'undefined' && document.documentElement.dir === 'rtl';