Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): command-click spaced folder links #6439

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/6439/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 121 additions and 14 deletions.

x
0 of 3 viewed, 3 left
10 additions and 12 deletionsapps/web/src/components/ChatMarkdown.tsxModified
View file
@@ -74,10 +74,12 @@
} from "../markdown-clipboard";
import { remarkNormalizeListItemIndentation } from "../markdown-list-indentation";
import {
+ extractMarkdownLinkHrefs,
normalizeMarkdownLinkDestination,
resolveInlineCodeFileLinkMeta,
resolveMarkdownFileLinkMeta,
rewriteMarkdownFileUriHref,
+ shouldOpenMarkdownFileLinkInEditor,
type MarkdownFileLinkMeta,
} from "../markdown-links";
import { readLocalApi } from "../localApi";
@@ -825,7 +827,6 @@
className?: string | undefined;
​
-const MARKDOWN_LINK_HREF_PATTERN = /\[[^\]]*]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)/g;
const MARKDOWN_FILE_LINK_CLASS_NAME =
"chat-markdown-file-link cursor-pointer transition-colors hover:bg-accent/70";
​
@@ -904,16 +905,6 @@
return spans;
​
-function extractMarkdownLinkHrefs(text: string): string[] {
- const hrefs: string[] = [];
- for (const match of text.matchAll(MARKDOWN_LINK_HREF_PATTERN)) {