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

New bleach config allowed_protocols #151

Open
xdml opened this issue Feb 3, 2025 · 1 comment
Open

New bleach config allowed_protocols #151

xdml opened this issue Feb 3, 2025 · 1 comment

Comments

@xdml
Copy link

xdml commented Feb 3, 2025

Currently it will not render phone links:

[+420 123 456 789](tel:+420123456789)

renders to

<a>+420 123 456 789</a>

instead of

<a href="tel:+420123456789">+420 123 456 789</a>

It is because default bleach configuration does not supports tel protocols and tel protocols have to be added manually, see mozilla/bleach#102.

So it will be nice to have configuration allowed_protocols.

@xdml
Copy link
Author

xdml commented Feb 3, 2025

Until #152 is fixed and committed, one can use following workaround (monkey patching).

Add into settings.py (settings/base.py):

import bleach.sanitizer
bleach.sanitizer.ALLOWED_PROTOCOLS += ['tel']

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