From 475a04630ae4d69037e1e8c19747099c07290c71 Mon Sep 17 00:00:00 2001 From: "Garen J. Torikian" Date: Mon, 26 Dec 2022 21:48:19 -0800 Subject: [PATCH] Add picture/source Closes https://github.com/gjtorikian/html-pipeline/issues/352 --- lib/html_pipeline/sanitization_filter.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/html_pipeline/sanitization_filter.rb b/lib/html_pipeline/sanitization_filter.rb index b6027fa8..24d7a726 100644 --- a/lib/html_pipeline/sanitization_filter.rb +++ b/lib/html_pipeline/sanitization_filter.rb @@ -17,10 +17,10 @@ class SanitizationFilter # allowed through by default. DEFAULT_CONFIG = Selma::Sanitizer::Config.freeze_config({ elements: ["h1", "h2", "h3", "h4", "h5", "h6", "br", "b", "i", "strong", "em", "a", "pre", "code", - "img", "tt", "div", "ins", "del", "sup", "sub", "p", "ol", "ul", "table", "thead", "tbody", "tfoot", + "img", "tt", "div", "ins", "del", "sup", "sub", "p", "picture", "ol", "ul", "table", "thead", "tbody", "tfoot", "blockquote", "dl", "dt", "dd", "kbd", "q", "samp", "var", "hr", "ruby", "rt", "rp", "li", "tr", "td", "th", "s", "strike", "summary", "details", "caption", "figure", "figcaption", "abbr", "bdo", "cite", - "dfn", "mark", "small", "span", "time", "wbr",], + "dfn", "mark", "small", "source", "span", "time", "wbr",], attributes: { "a" => ["href"], @@ -30,6 +30,7 @@ class SanitizationFilter "del" => ["cite"], "ins" => ["cite"], "q" => ["cite"], + "source" => ["srcset"], all: ["abbr", "accept", "accept-charset", "accesskey", "action", "align", "alt", "aria-describedby", "aria-hidden", "aria-label", "aria-labelledby", "axis", "border", "char", "charoff", "charset", "checked", "clear", "cols", "colspan", "compact", "coords", "datetime", "dir",