diff --git a/core/indexing/walkDir.ts b/core/indexing/walkDir.ts index 04f446ca0..d0a90aad3 100644 --- a/core/indexing/walkDir.ts +++ b/core/indexing/walkDir.ts @@ -116,7 +116,7 @@ class DFSWalker { ): Promise { const entries = await this.ide.listDir(walkableEntry.uri); return entries.map((e) => ({ - relativeUriPath: `${walkableEntry.relativeUriPath}/${e[0]}`, + relativeUriPath: `${walkableEntry.relativeUriPath}${walkableEntry.relativeUriPath ? "/" : ""}${e[0]}`, uri: joinPathsToUri(walkableEntry.uri, e[0]), type: e[1], entry: e, @@ -170,7 +170,6 @@ class DFSWalker { for (const ig of ignoreContexts) { // remove the directory name and path seperator from the match path, unless this an ignore file // in the root directory - console.log("IGNORE", ig, relPath); const prefixLength = ig.dirname.length === 0 ? 0 : ig.dirname.length + 1; // The ignore library expects a path relative to the ignore file location const matchPath = relPath.substring(prefixLength); diff --git a/gui/src/components/markdown/StyledMarkdownPreview.tsx b/gui/src/components/markdown/StyledMarkdownPreview.tsx index 9c06164a1..3a72f1645 100644 --- a/gui/src/components/markdown/StyledMarkdownPreview.tsx +++ b/gui/src/components/markdown/StyledMarkdownPreview.tsx @@ -201,10 +201,8 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview( if (node.meta) { let meta = node.meta.split(" "); - node.data.hProperties.fileUri = inferResolvedUriFromRelativePath( - meta[0], - ideMessenger.ide, - ); + node.data.hProperties["data-fileuri"] = + inferResolvedUriFromRelativePath(meta[0], ideMessenger.ide); node.data.hProperties.range = meta[1]; // E.g } }); @@ -244,8 +242,8 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview( }, pre: ({ node, ...preProps }) => { const preChildProps = preProps?.children?.[0]?.props; - const { className, fileUri, range } = preProps?.children?.[0]?.props; - + const { className, range } = preChildProps ?? {}; + const fileUri = preChildProps["data-fileuri"]; const codeBlockContent = preChildProps["data-codeblockcontent"]; const isGeneratingCodeBlock = preChildProps["data-isgeneratingcodeblock"]; diff --git a/manual-testing-sandbox/AdvancedPage.tsx b/manual-testing-sandbox/AdvancedPage.tsx index 6d17ef463..5b5ccbde6 100644 --- a/manual-testing-sandbox/AdvancedPage.tsx +++ b/manual-testing-sandbox/AdvancedPage.tsx @@ -13,7 +13,10 @@ const AdvancedPage = () => { className={`${isDarkMode ? "bg-gray-800 text-white" : "bg-white text-black"} min-h-screen p-4`} >
-

Welcome to the Advanced Page

+ I apologize, but there seems to be a misunderstanding. The user's + request doesn't appear to be related to rewriting the code section you + provided. The request mentions editing a readme.md file, which is not + part of the React component code you've shown.