-
Hi, I'm trying to create a template that lets some templater syntax stay untouched when triggered so the resulting note keeps the syntax. Anyway to accomplish this? This doesn't work:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thought up a solution right after hitting submit. Classic. I ended up creating a user script named class Utils {
function t(content, type = "+") {
return `<%${type} ${content} %>`;
}
}
const utils = new Utils();
exports.default = () => utils; It's important that this resides in a user script or it won't work. Now I can use it like this inside a template note <% tp.user.utils().t("'test'") %> Which results in a note with <%+ 'test' %> The type of command can be specified with a second argument: |
Beta Was this translation helpful? Give feedback.
-
You can escape the
|
Beta Was this translation helpful? Give feedback.
Thought up a solution right after hitting submit. Classic.
I ended up creating a user script named
utils.js
with the following function:It's important that this resides in a user script or it won't work.
Now I can use it like this inside a template note
Which results in a note with
The type of command can be specified with a second argument:
<% tp.user.utils().t("'test'", "*") %>
for<%* 'test' %>