Mermaid styles should not apply to all graphs, even on other panes

Did not find any relevant topic after searching the forum. Reproduce-able in a new vault, both with the new live preview mode and the legacy editor. Attached GIF recording below.

Steps to reproduce

  1. Create 2 new notes.
  2. Open both notes such that there are two panes.
  3. On both notes, make two mermaid graphs with no styling (see below).
  4. On the left pane, add mermaidJS line to the first graph: classDef default fill:red
  5. Observe changes on all graphs.

Expected result

Only the changed graph should change fill color. Other graphs should retain the default fill color from themes.

Actual result

The fill color on all graphs on all panes changes to red. More testing shows that all styles of all classes from all mermaid code blocks on all panes are accumulated and then applied to all graphs shown on the application.

I.e. Closing the left pane removes makes the style go back to normal.

Environment

  • Operating system: Arch Linux (Obsidian installed via Flathub)
  • Debug info:
SYSTEM INFO:
	Obsidian version: v0.13.14
	Installer version: v0.13.14
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Safe mode: on

RECOMMENDATIONS:
	none

Additional information

A sped-up recording of the bug (GIF loop starts with creation of new notes):

obsidian-graph-style

Also, as you can see in the GIF, sometimes a graph disappears on live preview mode when clicked away.

can’t repro this on 0.13.17

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.