Fix nh3 panic: use link_rel param instead of rel in attributes
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m43s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m43s
nh3 manages the rel attribute internally — setting it in tag_attributes triggers an assertion. Use link_rel parameter instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,7 @@ def _sanitize_html(html: str | None) -> str | None:
|
|||||||
},
|
},
|
||||||
attributes={
|
attributes={
|
||||||
"*": {"class", "id", "style"},
|
"*": {"class", "id", "style"},
|
||||||
"a": {"href", "title", "target", "rel"},
|
"a": {"href", "title", "target"},
|
||||||
"img": {"src", "alt", "title", "width", "height", "loading"},
|
"img": {"src", "alt", "title", "width", "height", "loading"},
|
||||||
"video": {"src", "controls", "width", "height", "poster"},
|
"video": {"src", "controls", "width", "height", "poster"},
|
||||||
"audio": {"src", "controls"},
|
"audio": {"src", "controls"},
|
||||||
@@ -55,6 +55,7 @@ def _sanitize_html(html: str | None) -> str | None:
|
|||||||
"td": {"colspan", "rowspan"},
|
"td": {"colspan", "rowspan"},
|
||||||
"th": {"colspan", "rowspan"},
|
"th": {"colspan", "rowspan"},
|
||||||
},
|
},
|
||||||
|
link_rel="noopener noreferrer",
|
||||||
url_schemes={"http", "https", "mailto"},
|
url_schemes={"http", "https", "mailto"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user