Skip to content

Commit b4d7303

Browse files
author
poulphunter
committed
add xml + "<svg" to detect if SVG is given
1 parent ac08101 commit b4d7303

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/MarkdownDisplay.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ const SVGBlock: MarkDownBlockType = ({ node, origContent, isGenerating }) => {
3939
)?.[1] ?? '',
4040
[origContent, startOffset]
4141
);
42-
const isSVG = !isGenerating && codeLanguage.startsWith('svg');
42+
const isSVG =
43+
!isGenerating &&
44+
(codeLanguage.startsWith('svg') ||
45+
(codeLanguage.startsWith('xml') && origContent.search(/<svg /g)));
4346

4447
return (
4548
<>

0 commit comments

Comments
 (0)