From 3c7f7741e6c499d15a9cecd42e6757b2ab766490 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 12 Jul 2024 04:00:42 -0700 Subject: [PATCH 1/3] Add simple panic messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #200 Co-authored-by: Laurențiu Nicola --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 45ba950..e25171e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1788,8 +1788,8 @@ impl<'a> Builder<'a> { .is_none()); } for tag_name in &self.clean_content_tags { - assert!(!self.tags.contains(tag_name)); - assert!(!self.tag_attributes.contains_key(tag_name)); + assert!(!self.tags.contains(tag_name), "`{tag_name}` appears in `clean_content_tags` and in `tags` at the same time"); + assert!(!self.tag_attributes.contains_key(tag_name), "`{tag_name}` appears in `clean_content_tags` and in `tag_attributes` at the same time"); } let body = { let children = dom.document.children.borrow(); From 4a8ae0a9289422040623dbba8aaf9ce94233e0d8 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 12 Jul 2024 08:13:36 -0700 Subject: [PATCH 2/3] Bump MSRV --- .github/workflows/main.yml | 2 +- Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 800fe1d..78a9b41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,7 +39,7 @@ jobs: - name: Set toolchain run: | rustup set profile minimal - rustup override set 1.60.0 + rustup override set 1.61.0 - name: Check run: cargo check --lib --all-features env: diff --git a/Cargo.toml b/Cargo.toml index 08daa1e..20e1d44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ documentation = "https://docs.rs/ammonia/" repository = "https://github.com/rust-ammonia/ammonia" categories = [ "web-programming", "text-processing" ] edition = "2021" -rust-version = "1.60" +rust-version = "1.61" [dependencies] html5ever = "0.27" diff --git a/README.md b/README.md index ea32107..80c98f6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ HTML Sanitization ================= [![Crates.IO](https://img.shields.io/crates/v/ammonia.svg)](https://crates.io/crates/ammonia) -![Requires rustc 1.60.0](https://img.shields.io/badge/rustc-1.60.0+-green.svg) +![Requires rustc 1.61.0](https://img.shields.io/badge/rustc-1.61.0+-green.svg) Ammonia is a whitelist-based HTML sanitization library. It is designed to prevent cross-site scripting, layout breaking, and clickjacking caused From 0fda008b4759e8b185acf3f1c843a625ced80af9 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 12 Jul 2024 08:13:43 -0700 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3cc443..d8a793e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Unreleased +* Bump MSRV to 1.61.0 +* Improve panic message when `clean_content_tags` conflicts with other options + # 4.0.0 * Update html5ever to 0.27