sanitizer: add a test to make sure <figure> is intact
Somehow with the old approach, `<figure>` is rearranged into `<head>`, 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
This commit is contained in:
@@ -9,5 +9,12 @@ final class SanitizerTest extends TestCase {
|
||||
Sanitizer::sanitize('<p>中文</p>')
|
||||
);
|
||||
}
|
||||
|
||||
public function test_sanitize_keep_figure(): void {
|
||||
$this->assertEquals(
|
||||
'<figure>Content</figure>',
|
||||
Sanitizer::sanitize('<figure>Content</figure>')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user