Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#5816 from ConnectAI-E/feature/artif…
Browse files Browse the repository at this point in the history
…acts-svg

artifacts support svg
  • Loading branch information
lloydzhou authored Nov 13, 2024
2 parents 819d249 + 9a86c42 commit a392daa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export function PreCode(props: { children: any }) {
const refText = ref.current.querySelector("code")?.innerText;
if (htmlDom) {
setHtmlCode((htmlDom as HTMLElement).innerText);
} else if (refText?.startsWith("<!DOCTYPE")) {
} else if (
refText?.startsWith("<!DOCTYPE") ||
refText?.startsWith("<svg") ||
refText?.startsWith("<?xml")
) {
setHtmlCode(refText);
}
}, 600);
Expand Down

0 comments on commit a392daa

Please sign in to comment.