Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templater commands cannot contain <% or %> #1508

Open
shui-dun opened this issue Dec 1, 2024 · 3 comments
Open

Templater commands cannot contain <% or %> #1508

shui-dun opened this issue Dec 1, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@shui-dun
Copy link

shui-dun commented Dec 1, 2024

The following script will throw an error: Templater Error: Template parsing error, aborting.
Template syntax error: Invalid or unexpected token

<%*
"<% %>";
%>

But the following script will not throw an error.

<%*
"hello";
%>
@shui-dun shui-dun added the bug Something isn't working label Dec 1, 2024
@shui-dun
Copy link
Author

shui-dun commented Dec 1, 2024

I encountered this issue when trying to output different content based on conditions.

<%*
if (!app.isMobile) {
	tR += "<% tp.file.cursor(2) %>";
}
%>

@shui-dun
Copy link
Author

shui-dun commented Dec 1, 2024

Temporary solution:

<%*
if (!app.isMobile) {
	tR += "<" + "% tp.file.cursor(2) %" + ">";
}
%>

@Zachatoo
Copy link
Collaborator

Zachatoo commented Dec 3, 2024

Likely won't fix this. This broke when the plugin switched from using EJS to rusty_engine. I don't have the capacity or know how to update rusty_engine to support this. Anyone is welcome to make a PR to rusty_engine to support this.

@Zachatoo Zachatoo changed the title script cannot contain <% and %> Templater commands cannot contain <% or %> Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants