From c8d3a9d1a926b244aadedb0d1811d8d8d4a4f4c0 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 13 Apr 2023 20:46:04 +0200 Subject: replace bleach with nh3 See https://github.com/mozilla/bleach/issues/698 nh3 is a small wrapper around https://crates.io/crates/ammonia - more Rust code in Fietsboek! \o/ The default seems to be to strip unknown tags instead of replace them with htmlentities, which is fine. Then the ", - Markup("<script>alert('evil')</script>")), + ("", Markup("")), + ("alert('evil')", Markup("

alert('evil')

")), ]) def test_safe_markdown(md_source, expected): assert util.safe_markdown(md_source) == expected -- cgit v1.2.3