Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bedrock/base/sanitization.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
# URL policy that allows common schemes for href and src attributes.
# Using default_handling="strip" ensures any URL attributes not explicitly
# listed are removed, preventing potential javascript: or other dangerous schemes.
_URL_RULE = UrlRule(allowed_schemes=["http", "https", "mailto", "tel"])
# handling="allow" on the rule preserves scheme-validated URLs as live links;
# without it, justhtml >=1.19 inherits default_handling="strip" per-rule and
# silently drops href/src on allowlisted <a>/<img> too.
_URL_RULE = UrlRule(allowed_schemes=["http", "https", "mailto", "tel"], handling="allow")
_URL_POLICY = UrlPolicy(
default_handling="strip",
allow_rules={
Expand Down
Loading
Loading