UnclosedHTMLElement
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
<!-- Dangling open/close must be in conditional branches of the same parent -->
<div>
{% if cond %}
<details>
{% endif %}
<p>
{% if cond %}
</details>
{% endif %}
</p>
</div>
<!-- They must open/close in the same condition -->
<div>
{% if something %}
<details>
{% endif %}
{% if something_else %}
</details>
{% endif %}
</div>
<!-- They must open/close in the correct order -->
<div>
{% if cond %}
<details
<summary>
{% endif %}
{% if cond %}
</details>
</summary>
{% endif %}
</div>
Anchor to ✓ Pass✓ Pass
<!-- They must open/close in the same condition -->
<div>
{% if something %}
<details>
{% endif %}
{% if something %}
</details>
{% endif %}
</div>
<!-- They must open/close in the correct order -->
<div>
{% if cond %}
<details>
<summary>
{% endif %}
{% if cond %}
</summary>
</details>
{% endif %}
</div>
<!-- `else` and `unless` evaluate to the negated condition identifier -->
<div>
{% if cond %}
{% else %}
<details>
{% endif %}
{% unless cond %}
</details>
{% endunless %}
</div>
Anchor to OptionsOptions
UnclosedHTMLElement
enabledtrue
severity warning
Parameter | Description |
---|---|
enabled | Whether this check is enabled. |
severity | The severity of the check. |
Anchor to Disabling this checkDisabling this check
Disabling this check isn't recommended.
Was this page helpful?