style
This commit is contained in:
@@ -482,7 +482,8 @@ export const RenderingNode = memo(function RenderingNode({ id, width, height }:
|
||||
? { width, height }
|
||||
: 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(() => {
|
||||
if (!renderedContent || !isSvgOutput) return
|
||||
@@ -600,7 +601,7 @@ export const RenderingNode = memo(function RenderingNode({ id, width, height }:
|
||||
<BaseNodeFooter>
|
||||
<NodeFooterEdgeIndicators nodeId={id} nodeType="render">
|
||||
{renderedContent
|
||||
? `${isSvgOutput ? 'Diagram' : 'Markdown'} · ${renderedContent.length} chars`
|
||||
? `${getConfigType(configTypeId).label} · ${renderedContent.length} chars`
|
||||
: error
|
||||
? 'Error'
|
||||
: '—'}
|
||||
|
||||
Reference in New Issue
Block a user