Files
stack/agents/researcher/work/queue-102/escape-bidi.mjs
T
jason.woltjeandClaude Sonnet 5.5 486c4aad34 research: row 102 build packet, row 88 follow-up N1-N4 (#1596)
Header sentence, line 13 wrap, bidi escapes in three files, inertCheck U+200E/U+200F. Patch and evidence only; the change is not applied to the tree.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-13 16:12:24 -05:00

12 lines
638 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Row 102 (#1596) N3: replace each literal bidi control character on the named line of the
// named file with its \u escape. Usage: node escape-bidi.mjs <file> <line>
import { readFileSync, writeFileSync } from 'node:fs';
const [file, lineNo] = process.argv.slice(2);
const BIDI = /[؜‎‏‪-‮⁦-⁩]/gu;
const lines = readFileSync(file, 'utf8').split('\n');
const i = Number(lineNo) - 1;
const before = lines[i];
lines[i] = before.replace(BIDI, (c) => '\\u' + c.codePointAt(0).toString(16).padStart(4, '0'));
if (lines[i] === before) throw new Error(`${file}:${lineNo}: no bidi character`);
writeFileSync(file, lines.join('\n'));