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

1 more end type than start type - block tag #153

Closed
Daniel-Knights opened this issue Mar 4, 2023 · 5 comments
Closed

1 more end type than start type - block tag #153

Daniel-Knights opened this issue Mar 4, 2023 · 5 comments
Labels
Bug Something isn't working in the vscode extension

Comments

@Daniel-Knights
Copy link

Formatting this:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta
    http-equiv="X-UA-Compatible"
    content="IE=edge"
  >
  <meta
    name="viewport"
    content="width=device-width, initial-scale=1.0"
  >
  <title>Document</title>
  <link rel="stylesheet" href="custom.css" />
</head>
<body>
  {% block %}{% endblock %}
</body>
</html>

Results in this:

ERROR: Parse error occured when formatting document

Prettify Error (line 18):
1 more end type than start type

If I remove {% block %}{% endblock %}, it formats fine.

Extension version 3.2.2.

@panoply panoply added the Bug Something isn't working in the vscode extension label Mar 4, 2023
@panoply
Copy link
Owner

panoply commented Mar 4, 2023

Hey @Daniel-Knights

I will have a look at this, but I believe it is addressed in #138. Can you try adding content within the {% block %}?

@Daniel-Knights
Copy link
Author

Hi, thanks @panoply. I tried with content, but get the same result

@panoply
Copy link
Owner

panoply commented Mar 5, 2023

I'm not sure of the exact issue, but likely related to <body> containment. It definitely addressed and fixed in #138 - however I still need to tie up some loose ends before it is shipped. If it possible for you execute that code in an isolated manner, like within an _include or snippet file where it is not encapsulated within a <body> element, things should work.

@Daniel-Knights
Copy link
Author

It does format, but the indentation isn't right:

<!DOCTYPE html>
      <html lang="en">
        <head>
          <meta charset="UTF-8">
          <meta http-equiv="X-UA-Compatible" content="IE=edge">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Document</title>
          <link rel="stylesheet" href="custom.css" />
        </head>
        <body>
          {% render "block" %}
        </body>
      </html>

Also, the block tag doesn't work as it should when moved to a separate file, but that's not really relevant here.

@panoply
Copy link
Owner

panoply commented Mar 15, 2024

This one is really stale but is was fixed some time ago!

@panoply panoply closed this as completed Mar 15, 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 in the vscode extension
Projects
None yet
Development

No branches or pull requests

2 participants