SOLVED: Formatting Brackets in Templates (Escaping)

Hello there,

I have been trying to make a meeting template for Drafts using the Roam Research formatting parameters. Here is the basic text of my template:

Meeting with [[]]

However, when I save this as a template using the “New Draft with Template” action, the final {{[[TODO]]}} gets formatted this way:


I know that this has something to do with the way brackets are coded but unfortunately I’m not super sharp on these things. Is there a way to format my template so that the output will be ready to go in the format I need?

Thanks in advance!

{{ }} is template engine markup to URL encode the text between the braces.

You can escape them so the template ignores that set by preceding them with a backslash, like \{{ }}

Alternately, you could edit the “New Draft with Template” action to not run the template through the template processor if you are not intentionally using any Drafts templates to insert dates, etc., as follows:

// find this line and comment it out...
// d.content = d.processTemplate(template.content);

// replace it with this line...
d.content = template.content;
1 Like

Perfect! Thank you so much.