Added tests.
This commit is contained in:
parent
20c5bfd22c
commit
0879e4e296
2 changed files with 11 additions and 1 deletions
|
@ -114,7 +114,7 @@ class App.Utils
|
|||
@_removeAttributes( html )
|
||||
|
||||
# remove tags, keep content
|
||||
html.find('a, font').replaceWith( ->
|
||||
html.find('a, font, small, time').replaceWith( ->
|
||||
$(@).contents()
|
||||
)
|
||||
|
||||
|
|
|
@ -296,6 +296,16 @@ test( "htmlClanup", function() {
|
|||
result = App.Utils.htmlClanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><small>some link to somewhere</small></a>"
|
||||
should = "<div>some link to somewhere</div>"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><time>some link to somewhere</time></a>"
|
||||
should = "<div>some link to somewhere</div>"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
equal( result.html(), should, source )
|
||||
|
||||
source = "<div><h1>some link to somewhere</h1><p><hr></p></div>"
|
||||
should = "<div>some link to somewhere</div><p></p><p></p>"
|
||||
result = App.Utils.htmlClanup( $(source) )
|
||||
|
|
Loading…
Reference in a new issue