diff options
author | ThibG <thib@sitedethib.com> | 2019-07-19 01:44:58 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-07-19 01:44:58 +0200 |
commit | fda437a02088ac114fecb69e3b1e52f495a2dd9a (patch) | |
tree | 1994cd719c8433485d82d57c476e6beaa56a7b66 /spec/lib | |
parent | 730c4053d642024b9949d72c8a9f1873532c6212 (diff) |
Fix sanitizing lists contents (#11354)
* Add test * Fix code for sanitizing nested lists stripping all tags
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/sanitize_config_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/lib/sanitize_config_spec.rb b/spec/lib/sanitize_config_spec.rb index bb3cf6f0b..54bd8693c 100644 --- a/spec/lib/sanitize_config_spec.rb +++ b/spec/lib/sanitize_config_spec.rb @@ -22,5 +22,9 @@ describe Sanitize::Config do it 'converts ul inside ul' do expect(Sanitize.fragment('<ul><li>Foo</li><li><ul><li>Bar</li><li>Baz</li></ul></li></ul>', subject)).to eq '<p>Foo<br>Bar<br>Baz</p>' end + + it 'keep links in lists' do + expect(Sanitize.fragment('<p>Check out:</p><ul><li><a href="https://joinmastodon.org" rel="nofollow noopener" target="_blank">joinmastodon.org</a></li><li>Bar</li></ul>', subject)).to eq '<p>Check out:</p><p><a href="https://joinmastodon.org" rel="nofollow noopener" target="_blank">joinmastodon.org</a><br>Bar</p>' + end end end |