Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 237f4b14 authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #8764 from cketti/html-allow-list-s

Keep `<s>` tags when sanitizing HTML
parents 827c224a 605a615c
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -13,7 +13,22 @@ internal class BodyCleaner {

    init {
        val allowList = Safelist.relaxed()
            .addTags("font", "hr", "ins", "del", "center", "map", "area", "title", "tt", "kbd", "samp", "var", "style")
            .addTags(
                "font",
                "hr",
                "ins",
                "del",
                "center",
                "map",
                "area",
                "title",
                "tt",
                "kbd",
                "samp",
                "var",
                "style",
                "s",
            )
            .addAttributes("font", "color", "face", "size")
            .addAttributes("a", "name")
            .addAttributes("div", "align")
+5 −0
Original line number Diff line number Diff line
@@ -467,6 +467,11 @@ class HtmlSanitizerTest {
        assertTagsNotStripped("var")
    }

    @Test
    fun `should keep 's' element`() {
        assertTagsNotStripped("s")
    }

    @Test
    fun `should keep 'base' element`() {
        val html =