BUGFIX: inline spoiler for text, block spoiler for images

This commit is contained in:
Régis Hanol
2014-01-15 00:53:06 +01:00
parent b024bebbe2
commit ad8755aa70
3 changed files with 20 additions and 12 deletions

View File

@ -40,8 +40,12 @@ describe PrettyText do
match_html "<p>hello <span class=\"mention\">@bob</span>'s <span class=\"mention\">@bob</span>,<span class=\"mention\">@bob</span>; <span class=\"mention\">@bob</span>\"</p>"
end
it 'should add spoiler tags' do
PrettyText.cook("[spoiler]hello[/spoiler]").should match_html "<p><div class=\"spoiler\">hello</div></p>"
it 'should spoiler text' do
PrettyText.cook("[spoiler]hello[/spoiler]").should match_html "<p><span class=\"spoiler\">hello</span></p>"
end
it 'should spoiler img' do
PrettyText.cook("[spoiler]<img src='http://cnn.com/a.gif'>[/spoiler]").should match_html "<p><div class=\"spoiler\"><img src=\"http://cnn.com/a.gif\"</div></p>"
end
end