Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
OPChips committed Nov 12, 2024
1 parent 459c373 commit 9a86c42
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 9a86c42

Please sign in to comment.