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
html5lib seems to order the attributes "not randomly" based on their initial ordering. they re-order endlessly between the two .
in our case, we "bleach" user content on input.
on certain screens, if something had to be bleached, we present the bleached result to the user to approve. because of this behavior, bleaching the content a second time will result in a document that doesn't match the input document.
there are workarounds that we employ for now, but it's messy. we just patched bleach to pass alphabetical_attributes=True into HTMLSerializer
it would be great if bleach either had some more default options for HTMLSerialize ( in _serialize ) or allowed for some configuration of defaults.
The text was updated successfully, but these errors were encountered:
I ran into a weird issue. It would seem that running something through the bleach multiple times will result in different output. here's a testcase - https://gist.github.com/jvanasco/2cda35740de8afc0a003
what happens is that the underlying HTMLSerializer will build the serialize the text differently, depending on the output
pay attention to the order of the attributes here:
and here:
html5lib seems to order the attributes "not randomly" based on their initial ordering. they re-order endlessly between the two .
in our case, we "bleach" user content on input.
on certain screens, if something had to be bleached, we present the bleached result to the user to approve. because of this behavior, bleaching the content a second time will result in a document that doesn't match the input document.
there are workarounds that we employ for now, but it's messy. we just patched bleach to pass
alphabetical_attributes=True
into HTMLSerializerit would be great if bleach either had some more default options for HTMLSerialize ( in
_serialize
) or allowed for some configuration of defaults.The text was updated successfully, but these errors were encountered: