Secondly, your proposed snippet works but only centers stored images, so those embedded with ![[]]. I would like external links to also be centered, such as youtube videos or PNG URLs that are embedded with ![](). Do you have a suggestion for that? My current snippet does that but perhaps there is a better way of achieving it.
Your setup steps were clear and easy to follow. Well done!
The rule causing the issue looks to be the !important on this line:
img {
display: block !important;
}
I’m not familiar with how latex-suite’s conceal, excalidraw, and Obsidian’s CSS work together and don’t have time to investigate further, but this fixes the issue on my end:
.view-content img {
display: block;
margin-inline: auto;
}
.markdown-source-view.mod-cm6 .cm-content > * {
margin: auto auto !important;
}
I would go with the below version though; it’s safer as it doesn’t change vertical margins in the editor (which can make the editor do strange things). Also, noticed iframes (embedded YouTube videos) weren’t centered in Reading view so added a rule for that. Hope this sorts you out: