Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for bleach 6 #87

Open
marksweb opened this issue Jan 26, 2023 · 0 comments
Open

Support for bleach 6 #87

marksweb opened this issue Jan 26, 2023 · 0 comments

Comments

@marksweb
Copy link
Owner

Bleach 6 has been released and is due to be the final version of bleach because it is now deprecated due to html5lib being unmaintained. Further details here.

The significant changes required to support version 6 are;

  • bleach.clean, bleach.sanitizer.Cleaner,
    bleach.html5lib_shim.BleachHTMLParser: the tags and protocols
    arguments were changed from lists to sets.
    bleach.clean(
        "some text",
        tags={"a", "p", "img"},
        #    ^               ^ set
        protocols={"http", "https"},
        #         ^               ^ set
    )
  • bleach.linkify, bleach.linkifier.Linker: the skip_tags and
    recognized_tags arguments were changed from lists to sets.
     bleach.linkify(
         "some text",
         skip_tags={"pre"},
         #         ^     ^ set
     )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant