So I’m sure this is super obvious to experienced Obsidian users, but I wanted to share a quick tip for fellow new users so they can avoid the headache I kept running into.
I was having this issue where various callouts, html snippets (like using <span> to display some targeted custom CSS), etc. just wouldn’t work. They kept rendering as raw code rather than displaying properly in live preview and reading mode.
FINALLY I realized it was because some of my straight quotation marks were being auto-converted to curly quotes! I think this is a feature of macOS? Not sure if it occurs on other operating systems. But basically I’d type " and it would automatically change to ” without me realizing it.
This even occurred when I copied code from other parts of my note or edited code already using the correct quotation mark type.
For example, I’m using Dataview queries to automatically pull values from a note’s properties/frontmatter.
I’d have a line like:
$= dv.current()["🗄️ category"]
and if I copied and pasted it to a different part of the note, and changed the text within the quotation marks (so I could easily switch which property was being queried) like to:
$= dv.current()["🗃️ subcategory"]
it would automatically change to this:
$= dv.current()["🗃️ subcategory”]
and of course that one little curly quotation mark at the end would stop it from rendering properly.
It took me way too long to notice this was happening so I just wanted to make a little PSA to hopefully save others from the same frustration!
—
Note: If you want this behavior to stop entirely so you don’t have to keep double-checking your quotes, you can turn this auto-correct off with the following steps on macOS:
-
Open System Settings, then click Keyboard in the sidebar.
-
Go to Text Input, then click Edit.
-
Turn off “Use smart quotes and dashes.”
Per: Apple’s support docs.
If you prefer to leave smart quotes turned on, there is also a suggested workaround here: using text replacement aka keyboard shortcuts
If this behavior also exists on other OS’s I’m not familiar with the process to change it on those but I assume there is a way.