You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [4]: bleach.clean("<random text")
Out[4]: '<random text'
Additional context
Previously it was fixed by #667, so that < without > considered as eof-in-tag-name, but in the case above it's considered as EOF in the attribute name -- 'eof-in-attribute-name':
392iflast_error_token:
393B->iflast_error_token["data"] =="eof-in-tag-name":
394# Handle the case where the text being parsed ends with <395# followed by a series of characters. It's treated as a tag396# name that abruptly ends, but we should treat that like397# character data398yield {
(Pdb)
399"type": TAG_TOKEN_TYPE_CHARACTERS,
400"data": "<"+self.currentToken["name"],
401 }
402else:
403yieldlast_error_token404405defconsumeEntity(self, allowedChar=None, fromAttribute=False):
406# If this tokenizer is set to consume entities, then we can let the407# superclass do its thing.408ifself.consume_entities:
409returnsuper().consumeEntity(allowedChar, fromAttribute)
(Pdb) last_error_token
{'type': 7, 'data': 'eof-in-attribute-name'}
The text was updated successfully, but these errors were encountered:
This adds handling for two more cases:
1. something like "<word word". This throws an eof-in-attribute-name
parser error.
2. something like "<word word=word". This throws an
eof-in-attribute-value-no-quotes error.
Both of these work correctly now.
Describe the bug
After #544 being fixed it seems the issue is still persist. But it reproducible in another way
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Additional context
Previously it was fixed by #667, so that
<
without>
considered aseof-in-tag-name
, but in the case above it's considered as EOF in the attribute name --'eof-in-attribute-name'
:The text was updated successfully, but these errors were encountered: