Is your feature request related to a problem? Please describe.
When tags and clean_content_tags overlap, the library fails with assertion failed: !self.tags.contains(tag_name) instead of giving an useful error message.
I've ran into this via nh3, but I think it could be useful to address in amonia.
Reproducer:
>>> nh3.clean('test', tags={'style'})
thread 'python' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ammonia-4.0.0/src/lib.rs:1791:13:
assertion failed: !self.tags.contains(tag_name)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
pyo3_runtime.PanicException: assertion failed: !self.tags.contains(tag_name)
Describe the solution you'd like
Get an error message that clean_content_tags and tags should not overlap.
Describe alternatives you've considered
I've figured out what is wrong after reading the code, but that it not really a friendly way to understand what went wrong.
Is your feature request related to a problem? Please describe.
When
tags
andclean_content_tags
overlap, the library fails withassertion failed: !self.tags.contains(tag_name)
instead of giving an useful error message.I've ran into this via nh3, but I think it could be useful to address in amonia.
Reproducer:
Describe the solution you'd like Get an error message that clean_content_tags and tags should not overlap.
Describe alternatives you've considered I've figured out what is wrong after reading the code, but that it not really a friendly way to understand what went wrong.