Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep Windows drive paths as chat file links #7182

Closedmaslinedwin(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/7182/headopened View on GitHub

Showing 5 changed files with 13 additions and 18 deletions (loading 4).

x
0 of 5 viewed, 5 left
13 additions and 18 deletionsapps/web/src/components/ChatMarkdown.tsxModified
View file
@@ -75,11 +75,13 @@
import { remarkNormalizeListItemIndentation } from "../markdown-list-indentation";
import {
normalizeMarkdownLinkDestination,
+ normalizeWindowsMarkdownFileLinks,
resolveInlineCodeFileLinkMeta,
resolveMarkdownFileLinkMeta,
rewriteMarkdownFileUriHref,
type MarkdownFileLinkMeta,
} from "../markdown-links";
+import { findTaskListMarkerOffset } from "../markdown-task-list";
import { readLocalApi } from "../localApi";
import { cn } from "../lib/utils";
import { useRightPanelStore } from "../rightPanelStore";
@@ -145,17 +147,6 @@
MAX_HIGHLIGHT_CACHE_MEMORY_BYTES,
​
-function findTaskListMarkerOffset(markdown: string, listItemStart: number): number | null {
- const firstLineEnd = markdown.indexOf("\n", listItemStart);
- const firstLine = markdown.slice(
- listItemStart,
- firstLineEnd === -1 ? markdown.length : firstLineEnd,
- );
- const match = firstLine.match(/^(?:\s*(?:[-+*]|\d+[.)])\s+)(\[[ xX]\])/);
- if (!match?.[1]) return null;
- return listItemStart + firstLine.indexOf(match[1]);
-}
-​