Skip to content

Commit

Permalink
feat: adds s tag as allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
taleksei committed Mar 14, 2018
1 parent 3447e1d commit 42e092d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/string_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions spec/string_tools_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
expect(with_default_config).to eq('<p style="text-align: center;"></p>')
end
end

context 'when string contains "s" tag' do
origin_string = '<s>text</s>'

it { expect(described_class.sanitize(origin_string)).to eq origin_string }
end
end

describe '#clear_unicode_separator_characters' do
Expand Down

0 comments on commit 42e092d

Please sign in to comment.