Conflict between Templater и Smart-Typography

I’m creating this topic in order to inform other users who might struggle as I did, so less people have so suffer figuring this out.

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 error

Templater Error: Template parsing error, aborting. 
 Bad template syntax

and an error message in the console that is not interpretable

Invalid or unexpected token
===========================
var tR='',__l,__lP,include=E.include.bind(E),includeFile=E.includeFile.bind(E)
function layout(p,d){__l=p;__lP=d}
const _prs = [];
_prs.push(tp.file.creation_date(“D MMMM YYYY“));
tR+='rJ2KqXzxQg'
tR+='\n\n'
const _rst = await Promise.all(_prs);
tR = tR.replace(/rJ2KqXzxQg/g, () => _rst.shift());
if(__l)tR=await includeFile(__l,Object.assign(tp,{body:tR},__lP))
if(cb){cb(null,tR)} return tR

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?

I posted my thoughts on both sides to Github issues of both of the plugins

1 Like