From f186e0c91cd378b9024c71a501d2217111ac5e3d Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 1 Jul 2020 00:06:22 +0200 Subject: [PATCH] =?UTF-8?q?Add=20support=20for=20=E2=80=9Cstart=E2=80=9D?= =?UTF-8?q?=20and=20=E2=80=9Creversed=E2=80=9D=20attributes=20to=20ol=20el?= =?UTF-8?q?ement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1367 --- app/lib/sanitize_config.rb | 1 + spec/lib/sanitize_config_spec.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb index dfd8b9f91..8b57b0f72 100644 --- a/app/lib/sanitize_config.rb +++ b/app/lib/sanitize_config.rb @@ -90,6 +90,7 @@ class Sanitize 'span' => %w(class), 'abbr' => %w(title), 'blockquote' => %w(cite), + 'ol' => %w(start reversed), }, add_attributes: { diff --git a/spec/lib/sanitize_config_spec.rb b/spec/lib/sanitize_config_spec.rb index 28a548c49..da24f67d6 100644 --- a/spec/lib/sanitize_config_spec.rb +++ b/spec/lib/sanitize_config_spec.rb @@ -13,6 +13,10 @@ describe Sanitize::Config do expect(Sanitize.fragment('

Check out:

', subject)).to eq '

Check out:

' end + it 'keeps start and reversed attributes of ol' do + expect(Sanitize.fragment('

Check out:

  1. Foo
  2. Bar
', subject)).to eq '

Check out:

  1. Foo
  2. Bar
' + end + it 'removes a without href' do expect(Sanitize.fragment('Test', subject)).to eq 'Test' end