From 42e092dff682f4a3f29cf9ab9be4a6c31acc3ec6 Mon Sep 17 00:00:00 2001 From: terentev Date: Wed, 14 Mar 2018 12:46:53 +0500 Subject: [PATCH] feat: adds s tag as allowed https://jira.railsc.ru/browse/GOODS-1146 --- lib/string_tools.rb | 2 +- spec/string_tools_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/string_tools.rb b/lib/string_tools.rb index 925f3c9..caccbc0 100644 --- a/lib/string_tools.rb +++ b/lib/string_tools.rb @@ -161,7 +161,7 @@ class Base 'img' => %w(src width height style) }.freeze - TAGS_WITHOUT_ATTRIBUTES = %w(b strong i em sup sub ul ol li blockquote br tr u caption thead).freeze + TAGS_WITHOUT_ATTRIBUTES = %w(b strong i em sup sub ul ol li blockquote br tr u caption thead s).freeze def sanitize(str, attrs = {}) # для корректного обрезания utf строчек режем через mb_chars diff --git a/spec/string_tools_spec.rb b/spec/string_tools_spec.rb index 7605f1a..2b0b338 100644 --- a/spec/string_tools_spec.rb +++ b/spec/string_tools_spec.rb @@ -66,6 +66,12 @@ expect(with_default_config).to eq('

') end end + + context 'when string contains "s" tag' do + origin_string = 'text' + + it { expect(described_class.sanitize(origin_string)).to eq origin_string } + end end describe '#clear_unicode_separator_characters' do