From 98ca727a252da8ead0c7a1891125f297ba74a0a1 Mon Sep 17 00:00:00 2001 From: timothymctim Date: Sun, 22 Sep 2024 16:22:12 +0200 Subject: [PATCH] Add ALLOWED_URL_SCHEMES constant (#55) --- nh3.pyi | 1 + src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/nh3.pyi b/nh3.pyi index 9a0127a..671fdc7 100644 --- a/nh3.pyi +++ b/nh3.pyi @@ -2,6 +2,7 @@ from typing import Callable, Dict, Optional, Set ALLOWED_TAGS: Set[str] ALLOWED_ATTRIBUTES: Dict[str, Set[str]] +ALLOWED_URL_SCHEMES: Set[str] def clean( html: str, diff --git a/src/lib.rs b/src/lib.rs index b408fd6..056747f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -240,5 +240,6 @@ fn nh3(_py: Python, m: &Bound) -> PyResult<()> { let a = ammonia::Builder::default(); m.add("ALLOWED_TAGS", a.clone_tags())?; m.add("ALLOWED_ATTRIBUTES", a.clone_tag_attributes())?; + m.add("ALLOWED_URL_SCHEMES", a.clone_url_schemes())?; Ok(()) }