Skip to content

Fix: Correct <div> tag handling in rtl_ltr_linter.py #12430

@Bhavishya2912

Description

@Bhavishya2912

rtl_ltr_linter.py

The script has a bug in the lint_file() function, where it incorrectly handles lines containing <div> tags.

### The lint_file function uses continue statements after detecting an opening or closing <div> tag. This causes the linter to stop processing the rest of the line. This is a bug because a single line can contain both an opening and a closing tag, such as <div dir="rtl">Some Text</div>.

The current logic would process the opening <div> but ignore the closing </div> on the same line, resulting in an inconsistent block_context_stack. This could cause the linter to incorrectly assume an RTL context for subsequent lines, leading to false positives or missed issues."

I have fixed this in PR : #12429
(Please check PR description for the issue and fix made)

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