Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep windows drive paths clickable in chat markdown #7189

ClosedCDVolvik(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7189/headopened View on GitHub

Showing 5 changed files with 140 additions and 4 deletions (loading 2).

x
0 of 5 viewed, 5 left
20 additions and 4 deletionsapps/web/src/components/ChatMarkdown.tsxModified
View file
@@ -73,11 +73,13 @@
serializeTableElementToMarkdown,
} from "../markdown-clipboard";
import { remarkNormalizeListItemIndentation } from "../markdown-list-indentation";
+import { remarkFilesystemLinkDestinations } from "../markdown-filesystem-links";
import {
normalizeMarkdownLinkDestination,
resolveInlineCodeFileLinkMeta,
resolveMarkdownFileLinkMeta,
rewriteMarkdownFileUriHref,
+ toFilesystemLinkUrl,
type MarkdownFileLinkMeta,
} from "../markdown-links";
import { readLocalApi } from "../localApi";
@@ -175,7 +177,7 @@
return { "--list-gutter": `${digits + 1}ch` };
​
-const CHAT_MARKDOWN_SANITIZE_SCHEMA = {
+export const CHAT_MARKDOWN_SANITIZE_SCHEMA: NonNullable<Parameters<typeof rehypeSanitize>[0]> = {
...defaultSchema,
attributes: {
...defaultSchema.attributes,
@@ -187,12 +189,13 @@
...defaultSchema.protocols,
href: [...(defaultSchema.protocols?.href ?? []), "file"],
-} satisfies Parameters<typeof rehypeSanitize>[0];