This commit is contained in:
2026-03-08 22:42:31 +01:00
parent 74fe1bed33
commit 9ce0d55370

View File

@@ -482,7 +482,8 @@ export const RenderingNode = memo(function RenderingNode({ id, width, height }:
? { width, height } ? { width, height }
: undefined : undefined
const isSvgOutput = Boolean(renderedContent?.trim().startsWith('<svg')) // Kroki and other SVG sources may prepend <?xml ... ?> so we detect by presence of <svg> tag
const isSvgOutput = Boolean(renderedContent?.trim() && /<svg[\s>]/i.test(renderedContent.trim()))
const downloadSvg = useCallback(() => { const downloadSvg = useCallback(() => {
if (!renderedContent || !isSvgOutput) return if (!renderedContent || !isSvgOutput) return
@@ -600,7 +601,7 @@ export const RenderingNode = memo(function RenderingNode({ id, width, height }:
<BaseNodeFooter> <BaseNodeFooter>
<NodeFooterEdgeIndicators nodeId={id} nodeType="render"> <NodeFooterEdgeIndicators nodeId={id} nodeType="render">
{renderedContent {renderedContent
? `${isSvgOutput ? 'Diagram' : 'Markdown'} · ${renderedContent.length} chars` ? `${getConfigType(configTypeId).label} · ${renderedContent.length} chars`
: error : error
? 'Error' ? 'Error'
: '—'} : '—'}