8000 [BUG] [Formatter] Jinja variable within a <script> tag · Issue #613 · djlint/djLint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[BUG] [Formatter] Jinja variable within a <script> tag #613
Closed
@davidbgk

Description

@davidbgk

System Info

  • OS: macOS Ventura
  • Python 3.11.2
  • djlint, version 1.25.0
  • Jinja2

Issue

First time user, I tried to reformat a template containing that code:

<script id="search-index" type="application/json">
  {{ search_index }}
</script>

And it always produces:

  <script id="search-index" type="application/json">
    {
      {
        search_index
      }
    }
  </script>

Whatever the kind of ignoring comment I put around that part of the HTML (which is probably another bug(?).

How To Reproduce

The command I use is the following:

djlint templates --profile=jinja --reformat --format-css --indent-css 2 --format-js --indent-js 2 --indent 2

I tried with or without the script's attributes (id and type) and there is no difference.

Hope it helps! (and I can provide more details on demand)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0