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

Indentation of Internet Explorer conditional comment #58

Closed
thibaudcolas opened this issue Feb 26, 2022 · 3 comments
Closed

Indentation of Internet Explorer conditional comment #58

thibaudcolas opened this issue Feb 26, 2022 · 3 comments
Labels
wontfix This will not be worked on

Comments

@thibaudcolas
Copy link

The following HTML:

<div>
<!--[if lt IE 9]>
    <p>Not supported</p>
<![endif]-->
</div>

gets indented as:

<div>
    <!--[if lt IE 9]>
    <p>Not supported</p>
<![endif]-->
</div>

I would have expected djhtml to apply the same amount of indentation to every line within the div. I imagine it’s IE conditional comments that are causing this – if so they probably don’t warrant any kind of support as they’re well past their expiration date. But I thought I’d report it anyway just in case.

@JaapJoris
Copy link
Member

Hi there, and thanks for reporting this!

When encountering a <!-- tag, DjHTML suspends all further indentation. This allows you to do, for instance, the following:

<!--
  ,-._|\
 /     .\
 \_,--._/
-->

And the rabbit will be preserved. The same logic applies to <pre> ... </pre>, /* ... */, and
{% comment %} ... {% endcomment %} tags.

There is an argument to be made to indent the contents within these tags to some degree, but since comments can contain just about everything I've decided they should just be left alone entirely. If you disagree, please explain in which cases DjHTML should indent comments, and in which cases it shouldn't.

@JaapJoris
Copy link
Member

In my previous comment I explained why I consider this the intended behavior. Since I haven't received a reason to change it, I'm closing this as wontfix. Feel free to reopen if you want to continue the discussion! 🤗

@JaapJoris JaapJoris added the wontfix This will not be worked on label Mar 21, 2022
@thibaudcolas
Copy link
Author

Forgot to reply! This makes complete sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants