mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-13 15:51:00 +00:00
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.
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user