cgiffard / Downsize

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

Allow for appending on strings without HTML #19

Closed stevehansell closed 10 years ago

stevehansell commented 10 years ago

Currently, calling downsize("A string without HTML", {words: 2, append: '...'} returns A string.

I changed (stack.length || tagBuffer.length) to isAtLimit(), which solves this issue and makes that line a little more clear.

Tests included.

adam-zethraeus commented 10 years ago

Looks good and doesn't break any tests :)