Templater and nagging extra space

Things I have tried

I have a templater template which I call that provides a suggester with template options, and then runs the desired template.

It works, but there’s one nagging issue: the resulting file, filled by the called template, has an extra space at the beginning, which means the beginning “—” of the front matter isn’t correctly recognized.

I’ve tried using Whitespace control to get rid of that extra space, but no luck.

What I’m trying to do

Here is the template, with only one of the options given:

let filetype = await tp.system.suggester([“Youtube Video”, “Youtube Channel”, “Blog Article”, “Blog Article Author”],[“Youtube Video”, “Youtube Channel”, “Blog Article”, “Blog Article Author”], false, “Which template do you want to use?”)
<%-* if (filetype === “Youtube Video”) { %>
<%- tp.file.include(“[[Youtube Video TemplateR]]”) _%>
<%-* }

If I run “Youtube Video TemplateR” directly, it creates the new note, with no extra space.

What am I missing?

I think

<%_ tp.file.include("[[Youtube Video TemplateR]]") _%>

should do the trick?

1 Like

That was it! Thanks!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.