From 1db970d3854eaaa616e59d95ba925065239ff105 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Wed, 8 Apr 2026 21:51:36 +0200 Subject: [PATCH] fix(web): use /gitfile endpoint instead of removed /gitraw The git raw handler was removed in favor of the unified /gitfile endpoint (#1550) which supports both hash and ref+path lookups. Co-Authored-By: Claude Opus 4.6 (1M context) --- webui2/src/components/content/markdown.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webui2/src/components/content/markdown.tsx b/webui2/src/components/content/markdown.tsx index 40a9f17fb3dc291587da924c6cb035862e9b975f..a2a73cf168b6248310ca2a81950a03cee899825d 100644 --- a/webui2/src/components/content/markdown.tsx +++ b/webui2/src/components/content/markdown.tsx @@ -95,7 +95,7 @@ function useShikiHighlighter(): HighlighterCore | null { export function Markdown({ content, className, repoContext }: MarkdownProps) { const highlighter = useShikiHighlighter(); - // Rewrite image src to /gitraw for raw content serving. + // Rewrite image src to /gitfile for raw content serving. // Links are handled by the custom `a` component below. const urlTransform = useMemo(() => { if (!repoContext) return undefined; @@ -104,7 +104,7 @@ export function Markdown({ content, className, repoContext }: MarkdownProps) { if (!isRelativeUrl(url)) return url; const resolved = resolveRelativePath(basePath, url); if (isImagePath(resolved)) { - return `/gitraw/${repo}/${ref}/${resolved}`; + return `/gitfile/${repo}/${ref}/${resolved}`; } // Non-image relative URLs are handled by the `a` component override, // but urlTransform runs first, so we still need to return something. @@ -116,12 +116,12 @@ export function Markdown({ content, className, repoContext }: MarkdownProps) { const components = useMemo(() => { if (!repoContext) return undefined; const { repo, ref, basePath } = repoContext; - const gitrawPrefix = `/gitraw/${repo}/${ref}/`; + const gitfilePrefix = `/gitfile/${repo}/${ref}/`; return { img: ({ src, alt, ...props }: React.ImgHTMLAttributes) => { // Wrap repo-local images in a Link to the blob view - if (src?.startsWith(gitrawPrefix)) { - const path = src.slice(gitrawPrefix.length); + if (src?.startsWith(gitfilePrefix)) { + const path = src.slice(gitfilePrefix.length); return ( {alt}