Skip to content

Commit 77716eb

Browse files
fix(link): strip the Arabic Letter Mark with the other bidi controls
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
1 parent 7ae2ff6 commit 77716eb

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/opencode/src/cli/cmd/link.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ export function stripControlChars(text: string): string {
6060
// covered C0/DEL, leaving C1 controls unstripped. ESC (the OSC 8 breakout
6161
// vector) was always covered, but the doc comment claimed C1 coverage it
6262
// didn't have. (Kilo, PR #1274.)
63-
// Plus the Unicode bidi controls (LRM/RLM, LRE..RLO, LRI..PDI): they cannot break out of the
63+
// Plus the Unicode bidi controls (ALM, LRM/RLM, LRE..RLO, LRI..PDI): they cannot break out of the
6464
// hyperlink (the href is always `buildManageUrl`, never the name) but can visually reverse or
6565
// reorder the displayed name in the picker. (v0.11.2 release review.)
6666
// eslint-disable-next-line no-control-regex
67-
return text.replace(/[\x00-\x1f\x7f-\x9f\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, "")
67+
return text.replace(/[\x00-\x1f\x7f-\x9f\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g, "")
6868
}
6969

7070
/** Sanitized display name for a ``ConflictError``'s existing-binding name,

‎packages/opencode/test/skill/release-v0.11.2-adversarial.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ describe("v0.11.2 adversarial: stripControlChars", () => {
153153
const ranges: [number, number][] = [
154154
[0x00, 0x1f],
155155
[0x7f, 0x9f],
156+
[0x061c, 0x061c],
156157
[0x200e, 0x200f],
157158
[0x202a, 0x202e],
158159
[0x2066, 0x2069],

0 commit comments

Comments
 (0)