Repository navigation
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
19 of 23 tasks
Member
Author
|
Folded into #1143: the fix is now a commit on that branch. |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
An assistant answer that names a file, such as
notes.md, rendered the name as a link tohttp://notes.md. This stops bare filenames being linked in chat answers.components/AgentChat/MarkdownMessage.tsx) runs markdown-it withlinkify: true. Its matcher, linkify-it, links any schemelessname.tldwhose last part is a known top-level domain, and that list includes every two-letter country code..md,.py,.sh,.rs,.cc,.pland.soare all country codes, and.org,.proand.infoare generic ones, sonotes.md,analysis.py,run.sh,main.rs,todo.orgall became links. Extensions that are not domains (.csv,.pdf,.ts,.json) were never affected.www.. The matcher's results are filtered: a match with no scheme is dropped unless it begins withwww.. Everything else linkify-it finds is kept as it was.Still linked: anything with a scheme (
https://example.com/notes.md,http://example.org),www.example.com, explicit markdown links,<https://…>autolinks, and email addresses.No longer linked: bare filenames, and also bare domains written without a scheme or
www.(example.com,claude.ai,researchhub.com/paper/1). The two cannot be told apart from the text alone, sincetodo.organdnature.orghave the same shape.Notes
MarkdownMessageis the only user of markdown-it in the app. It renders assistant answers, and the narration, thinking and tool-draft text in the activity feed, in both the notebook's assistant panel and the assistant chat. Nothing outside the agent chat uses it: user messages in the chat are plain text, the editor has its own link handling, andDraftBlockPreviewshares only the sanitizer options.md.linkify.matchon this file's own markdown-it instance, which is the call markdown-it's linkify rule makes for running text. Matches that carry a scheme, includingmailto:and//, pass through it unchanged.Test plan
npm run type-checknpm run lint(0 errors; the 2 warnings are onmainin files this PR does not touch)prettier --checkon the changed filenpm run buildnotes.md,analysis.py,run.sh,main.rs,lib.cc,todo.org,project.proand the bare domainsexample.com,claude.ai,researchhub.com/paper/1are plain text;https://example.com/notes.md,http://example.org,www.example.com,www.site.de/path,[the docs](https://example.com/docs/readme.md),<https://example.md>andsomeone@example.comare links that open in a new tab. The same answer on the unfixed renderer linked all seventeenWWW.in capitals; awww.link followed by a full stop; a paragraph mixing filenames and real linkssmokefails on one test,auth.spec.ts:68(register a new account), which fails the same way on other open PRs