FIX: details tags broke excerpts

This commit is contained in:
Robin Ward
2017-12-19 17:28:55 -05:00
parent c1716d41c7
commit b3fda0ea86
5 changed files with 31 additions and 1 deletions

View File

@ -385,6 +385,10 @@ describe PrettyText do
expect(PrettyText.excerpt("<span class='spoiler'>spoiler</div>", 100)).to match_html "<span class='spoiler'>spoiler</span>"
end
it "should keep details" do
expect(PrettyText.excerpt("<details><summary>expand</summary><p>hello</p></details>", 30)).to match_html "<details><summary>expand</summary></details>"
end
it "should remove meta informations" do
expect(PrettyText.excerpt(wrapped_image, 100)).to match_html "<a href='//localhost:3000/uploads/default/4399/33691397e78b4d75.png' class='lightbox' title='Screen Shot 2014-04-14 at 9.47.10 PM.png'>[image]</a>"
end