From f1a9ac9b159127e8eb7c301e9a646eabb188e1af Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen <645432-yan12125@users.noreply.gitlab.com> Date: Fri, 15 Dec 2023 13:12:26 +0800 Subject: [PATCH] sanitizer: add a test to make sure
is intact Somehow with the old approach, `
` is rearranged into ``, and the latter is stripped by `Sanitizer::strip_harmful_tags()` (see [1]). The issue is fixed by [2]. Here I added a test for the regression. [1] https://community.tt-rss.org/t/unexpected-behavior-with-figure-tag/6244 [2] https://gitlab.tt-rss.org/tt-rss/tt-rss/-/commit/67012f9dac7de22615b72be93fa360f53fefe3ec --- tests/integration/SanitizerTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/integration/SanitizerTest.php b/tests/integration/SanitizerTest.php index 1981079f0..421d046af 100644 --- a/tests/integration/SanitizerTest.php +++ b/tests/integration/SanitizerTest.php @@ -9,5 +9,12 @@ final class SanitizerTest extends TestCase { Sanitizer::sanitize('

中文

') ); } + + public function test_sanitize_keep_figure(): void { + $this->assertEquals( + '
Content
', + Sanitizer::sanitize('
Content
') + ); + } }