Skip to content

Commit 4c8e626

Browse files
authored
fix(remark-mermaid): Restrict MutationObserver to theme attributes to prevent diagram disappearing (#2102)
1 parent 3f9d0dd commit 4c8e626

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/remark-mermaid/src/mermaid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function Mermaid({ chart }: { chart: string }): ReactElement {
3838
}
3939
const htmlElement = document.documentElement;
4040
const observer = new MutationObserver(renderChart);
41-
observer.observe(htmlElement, { attributes: true });
41+
observer.observe(htmlElement, { attributes: true, attributeFilter: ['class', 'data-theme'] });
4242
renderChart();
4343

4444
return () => {

0 commit comments

Comments
 (0)