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

Handling <!doctype html> #86

Open
PaulMarcantonio opened this issue Sep 22, 2021 · 1 comment
Open

Handling <!doctype html> #86

PaulMarcantonio opened this issue Sep 22, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@PaulMarcantonio
Copy link

Describe the bug

When running curlylint on a basic html template I noticed that the "<!doctype html>" was causing false positive Bad indentation and parent inline element issues. Once I commented out the "<!doctype html>" all tests passed.

Which terms did you search for in the documentation and issue tracker?

"<!doctype html>"
Notices other blogs were taking the same steps I did

motet-a/jinjalint#16

Environment

Windows 2012R2
Curlylint ver => 0.13.0
Python ver 3.7.6

Steps to reproduce

(Write your steps here:)

  1. create a simple html doc with <!doctype html> tag
  2. add some html items
  3. test with tag in place then with out

Expected behavior

You should see different results based on the state of the <!doctype html> tag

Actual behavior

@PaulMarcantonio PaulMarcantonio added the bug Something isn't working label Sep 22, 2021
@Scotchester
Copy link

I think I may have just run into the same (or a related) issue.

I wanted to comment my Django load tags to keep track of what they were, like so:

{% load static %} {# Django #}
{% load wagtailsettings_tags wagtailuserbar %} {# Wagtail #}
{% load compress %} {# Third-party #}
{% load custom_filters django_setting feature_flags %} {# Custom #}
{% get_settings %} {# make Wagtail settings objects available in the template #}

<!DOCTYPE html>

Adding the comments seen above triggered the "An inline parent element must only contain inline children" error on the DOCTYPE line and a whole slew of "Bad indentation" errors throughout the rest of the file. I tried with and without a space between the tag and the comment, and tried the comments before and after the tags. Same results each time.

Simply moving them under the DOCTYPE fixed the curlylint errors, like so:

<!DOCTYPE html>
{% load static %} {# Django #}
{% load wagtailsettings_tags wagtailuserbar %} {# Wagtail #}
{% load compress %} {# Third-party #}
{% load custom_filters django_setting feature_flags %} {# Custom #}
{% get_settings %} {# make Wagtail settings objects available in the template #}

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