Skip to content

Fix: lint_file() fails to process lines containing both opening and closing <div> tags #12500

@smitrajurkar

Description

@smitrajurkar

The lint_file() function has a bug in how it handles lines containing

tags currently, the function uses continue statements after detecting an opening or closing
tag.This causes the linter to stop processing the remainder of the line, even if it contains additional tags.
A single line can contain both an opening and a closing tag, such as:

Some Text

With the current logic:

The opening

is processed.

The closing

is ignored, since the function continues to the next iteration after handling the first tag.

This leads to an inconsistent block_context_stack, which can cause:

The linter to incorrectly assume an RTL context for subsequent lines.

False positives or missed issues in linting results.

Remove premature continue statements.

Allow full parsing of the line, ensuring both opening and closing tags are properly processed.

Please check the PR description for detailed information on the issue and fix.

Pull Request: #12429

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions