From eba3411bfa40cbb36205f58a36e34c446fed0ffa Mon Sep 17 00:00:00 2001 From: Plastikmensch Date: Mon, 19 Jun 2023 18:01:35 +0200 Subject: [PATCH] Re-allow title attribute in (#2254) * Re-allow title attribute in This was accidentally removed in 7623e181247b4d2227b7774143514f6e1ca9253b Signed-off-by: Plastikmensch * Add test Add a new test to check that title attribute on is kept. Signed-off-by: Plastikmensch --------- Signed-off-by: Plastikmensch --- lib/sanitize_ext/sanitize_config.rb | 1 + spec/lib/sanitize_config_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/sanitize_ext/sanitize_config.rb b/lib/sanitize_ext/sanitize_config.rb index 0ee3a519b..f3eb9c075 100644 --- a/lib/sanitize_ext/sanitize_config.rb +++ b/lib/sanitize_ext/sanitize_config.rb @@ -74,6 +74,7 @@ class Sanitize attributes: { 'a' => %w(href rel class title), + 'abbr' => %w(title), 'span' => %w(class), 'blockquote' => %w(cite), 'ol' => %w(start reversed), diff --git a/spec/lib/sanitize_config_spec.rb b/spec/lib/sanitize_config_spec.rb index 29344476f..586a43d59 100644 --- a/spec/lib/sanitize_config_spec.rb +++ b/spec/lib/sanitize_config_spec.rb @@ -43,6 +43,10 @@ describe Sanitize::Config do it 'keeps a with supported scheme and no host' do expect(Sanitize.fragment('Test', subject)).to eq 'Test' end + + it 'keeps title in abbr' do + expect(Sanitize.fragment('HTML', subject)).to eq 'HTML' + end end describe '::MASTODON_OUTGOING' do