This only happens with some SVGs. I’ll provide one that triggers the bug below.
Steps to reproduce
- Open a new obsidian note.
- Paste in an SVG that triggers the bug.
- Observe that in edit mode the output is correct
- Observe that in reading mode the output is different and incorrect.
- Paste SVG into an external SVG renderer / html and observe that the output is always correct.
Expected result
This SVG should be rendered on the page:
Actual result
In reading mode this SVG is rendered on the page instead:
Environment
- Operating system: Windows 11 Home
- Debug info:
SYSTEM INFO:
Obsidian version: v0.15.9
Installer version: v0.15.9
Operating system: Windows 10 Home 10.0.22622
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on
RECOMMENDATIONS:
none
Additional information
Here is a paste bin of the above SVG file which triggers the bug.
SVG Code
Here is a link showing the SVG being rendered correctly in an html file:
nathang.dev/fileshare/svg_test.html
This SVG was originally generated using tikz. Here is the tikz code, however I don’t think this is probably relevant considering the SVG is rendered correctly everywhere other than obsidian:
% Required packages
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}[thick,
set/.style = {circle,
minimum size = 3cm,
fill=orange},
background rectangle/.style={fill=orange}, show background rectangle]
% Set A
\node[set,label={135:$A$}] (A) at (0,0) {};
% Set B
\node[set,label={45:$B$}] (B) at (1.8,0) {};
% Intersection
\begin{scope}
\clip(0,0) circle(1.5cm);
\clip (1.8,0) circle(1.5cm);
\fill[white] (0,0) circle(1.5cm);
\end{scope}
% Circles outline
\draw (0,0) circle(1.5cm);
\draw (1.8,0) circle(1.5cm);
\end{tikzpicture}
\end{document}