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

[BUG] [Formatter] #931

Open
3 tasks done
TomFaulkner opened this issue Oct 8, 2024 · 2 comments
Open
3 tasks done

[BUG] [Formatter] #931

TomFaulkner opened this issue Oct 8, 2024 · 2 comments
Labels
🦠 bug Something isn't working 🧽 formatter

Comments

@TomFaulkner
Copy link

System Info

  • OS: Arch, up do tate
  • Python Version: 3.12
  • djLint Version 1.35.2
  • template language: jinja

Issue

Some includes are formatted in such a way that it breaks the include.

How To Reproduce

Format this:

    <script>
        {% include "shared/_base/components/toast.js" %}
    </script>

And the result is:

   <script>
        {
            % include "shared/_base/components/toast.js" %
        }
    </script>

With the whitespace between the brace and percent sign, Jinja doesn't process this include.

I am aware that this isn't ideal for how to use JS, and it should be a file hosted on the server, but I have this currently until I get other things setup.

@TomFaulkner TomFaulkner added 🦠 bug Something isn't working 🧽 formatter labels Oct 8, 2024
@JCWasmx86
Copy link
Contributor

Those template expressions in JS need to be wrapped within

/* beautify ignore:start */
{% include "shared/_base/components/toast.js" %}
/* beautify ignore:start */

(Not ideal, but good enough)

@TomFaulkner
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦠 bug Something isn't working 🧽 formatter
Projects
None yet
Development

No branches or pull requests

2 participants