Skip to content

bug: Open left angle bracket followed immediately by an alpha character causes next tag to be sanitized #733

@fayyazul-centaurlabs

Description

@fayyazul-centaurlabs

Describe the bug

The tag immediately following an unclosed left angle bracket (used in a "less than context") causes the next tag to be sanitized

  • Python Version: 3.12.2
  • Bleach Version: 6.1.0

To Reproduce

Steps to reproduce the behavior:

>>> bleach.clean('<t <a></a> <a></a>')
'&lt;t &lt;a&gt; <a></a>'

Expected behavior

>>> bleach.clean('<t <a></a> <a></a>')
'&lt;t <a></a> <a></a>'

Additional context

The above error does not occur for non-alpha characters:

>>> bleach.clean('<5 <a></a> <a></a>')
'&lt;5 <a></a> <a></a>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedBug reports that haven't been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions