SVG gradient rendered differently in Live Preview vs Preview

A quick fix for this issue would be if Obsidian changed the IDs in markdown-reading-view to something unique.
For example if I run this in the developer console, it finds all the elements with IDs and then appends -fix to those IDs, but also makes the change in the places where the IDs are used.

document.querySelectorAll(".markdown-reading-view [id]").forEach((el) => {
  const id = el.id;
  const readingView = document.querySelector(".markdown-reading-view");

  readingView.innerHTML = readingView.innerHTML.replaceAll(id, id + "-fix")
})

This makes the gradient visible again and makes arrows visible in mermaid diagrams (Mermaid: arrows not showing).

But I can’t say if this could have any negative side-effects… it feels a bit hacky.
Maybe the replace should be done only to elements which are within an <svg> element, to avoid accidentally changing user written content.