style
This commit is contained in:
@@ -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'
|
||||||
: '—'}
|
: '—'}
|
||||||
|
|||||||
Reference in New Issue
Block a user