cgiffard / Downsize

Tag safe text truncation for HTML and XML!
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

Trailing empty tags occur. #8

Closed adam-zethraeus closed 10 years ago

adam-zethraeus commented 10 years ago

Trailing empty tags occur.

i.e.

it("should not have trailing empty tags", function () {
    downsize("<p>there are five words here</p><i>what</i>", {words: 5})
        .should.equal("<p>there are five words here</p>");
});

result:

  AssertionError: expected '<p>there are five words here</p><i></i>' to equal '<p>there are five words here</p>'
  + expected - actual

  +"<p>there are five words here</p>"
  -"<p>there are five words here</p><i></i>"