Find a solution for Templater scripts breaking visually within template files

Use case or problem

This is probably minor, since functionality remains intact (AFAIK), but looks broken within template files

Proposed solution

I’m not sure what solution we can think of, maybe a set of delimiters like content with spaces for functions that include spaces so they can be processed/displayed as functions and not as the actual content,


:point_up_2:t2: This is how it looks like

1 Like

You can prevent Properties to try and parse the YAML of the Templater’s template by escaping the opening and closing --- using Templater’s syntax :blush:

For example:

<%"---"%>
 // template goes here
<%"---"%>

It shouldn’t change a thing when you run the template as Templater will just write --- where <%"---"%> was used :blush:

(At least, that’s the result I’ve got while Properties was in beta :blush: )

6 Likes

This seems like a nice workaround in the meantime ! :hugs:
Thank you !

Thanks a lot this looks a simple implementation and can avoid the undesirable behaviours I’m having with templater and templates’s syntax and properties

1 Like

No need to thank me :blush: !

All I did was passing along a Properties/Templater trick I thought would be useful here :wink: .

It was circulating on Discord and it’s one of the Templater snippets Zachatoo shared on their blog: Escaping frontmatter in a template

I’m very glad to know it helped :grin: !

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