Open Xallt opened 2 years ago
I see there is another similar issue https://github.com/mgmeyers/obsidian-smart-typography/issues/12 about another framework suffering from not being able to parse the curly quotes correctly Maybe the quote conversion feature should be turned off by default? Because of how many conflicts it can cause with other frameworks, and how the user may have a bad time figuring the problem out.
The issue here seems to be that templater syntax highlighting does not work with obsidian's new editor: https://github.com/SilentVoid13/Templater/issues/491
Smart typography checks to see if the cursor is inside a templater block before executing, but this is not currently possible because templater blocks are no longer highlighted.
It's not the best solution, but you can undo smart typography's character conversion by pressing delete/backspace immediately after typing a quote.
One of the features of the Smart-Typography plugin is automatically turning standard double quotes into curly double quotes ("" → ““). This is a very subtle change that is hard to notice, and I didn't even know about this until I discovered my issue (I initially downloaded the plugin just for em-dashes).
At some point I started setting up the plugin Templater and encountered an issue where, when creating simple templates (for example, just inserting the creation date
<% tp.file.creation_date(“D MMMM YYYY“)%>
), while processing the template, Templater crashed with a parsing errorand an error message in the console that is not interpretable
After some digging around, I finally discovered that the issue was in Templater not being able to parse the curly quotes, and everything was, of course, fixed by using the standard quotes.
Preventive measures?
Would it make sense to implement a check for whether currently the cursor is located inside brackets like <\%\%> or other variations, and turn off the quote conversion when that is true? I understand that the user might start typing the Templater command outside of the <\%\%> brackets and add them afterwards. But still, some countermeasures might prevent baffled users like me.