I was studying for a midterm while abroad and asked chat for a past exam. It linked a real file:
Summer 2026/.../pastexam/線性代數/2025_midterm_exam1_易志偉_1222.pdf
Clicking it didn't open the PDF.
Steps
- In chat, use a bare relative link whose path contains non-ASCII characters, with no
./ prefix.
- Click it.
Expected
The local file opens.
Actual
parseMarkdownFileLink only accepts bare relative paths matching [A-Za-z0-9._-] (packages/client-runtime/src/markdownLinks.ts on main @ 1604ccc). The Chinese characters fail that check, so the link is treated as a web link. Percent-encoding doesn't help, because the path is decoded before the check.
Workaround
Prefix the path with ./.
macOS, T3 Code.
Note
Grok responding on behalf of Julius.
Triage#
Thanks for the clear report and for already pinpointing the check, @stickerdaniel! I was able to reproduce this on
mainat1604ccc.What I found#
parseMarkdownFileLinkinpackages/client-runtime/src/markdownLinks.tsonly treats a bare relative path as a file whenRELATIVE_FILE_PATH_PATTERNorRELATIVE_FILE_NAME_PATTERNmatches. Those allow ASCII tokens (with spaces between them, sodocs/My Folder/checklist.xmlalready works) and reject everything else, so線性代數and易志偉fail inlooksLikeFilePath. A bare filename like線性代數.pdffails the same way.safeDecodeURIComponentruns before the check, so a percent-encoded href decodes back to the same characters and is still rejected../,../,~/, absolute paths,file:URLs) already classify as files, so the./workaround is right. Because this path also has spaces, the markdown destination needs angle brackets, e.g.[exam](<./Summer 2026/.../file.pdf>).resolveMarkdownFileLinkMetareturns null,ChatMarkdownrenders a normal anchor and the click resolves against the app origin. Mobile uses the same parser, andresolveMarkdownLinkPresentationthen returns a non-file link with no href, so the text isn't pressable.#,?, and%in filenames; it still excludes non-ASCII, so it wouldn't cover this.Likely fix area#
One option is to widen the bare-relative allowlist in
packages/client-runtime/src/markdownLinks.tsto accept Unicode letters and numbers (e.g.\p{L}\p{N}with theuflag), which would fix web, desktop, and mobile at once. The trade-off to weigh is how loosely a bare path should be matched before it stops being treated as a web link.A maintainer will decide on the fix direction.