Skip to content

Commit

Permalink
Merge pull request #201 from rust-ammonia/notriddle/panic-msg
Browse files Browse the repository at this point in the history
Add simple panic messages
  • Loading branch information
notriddle committed Jul 12, 2024
2 parents b93f1c6 + 0fda008 commit 25017a4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 25017a4

Please sign in to comment.