6

Is there a jquery truncate plugin that doesn't have trouble with HTML in the content?

For instance this plugin does not handle HTML well:

http://www.reindel.com/truncate/

Jourkey
  • 33,710
  • 23
  • 62
  • 78

3 Answers3

5

I'm assuming you've got the most recent version.

There's a couple more here which might may help. Can't comment on their suitability, though:

http://github.com/jsillitoe/jquery-condense-plugin/tree

http://code.google.com/p/jquery-text-truncate/

James Wiseman
  • 29,946
  • 17
  • 95
  • 158
  • condense works for me. I can't say my testing was extensive though. But thanks. – Jourkey Jan 09 '10 at 21:54
  • 4
    @James Wiseman: +1; thanks for the link to jQuery Condense plugin! I put up its demo here: http://jsfiddle.net/Sk8erPeter/sqDx8/1/. So people who would like to see how it works before they download it, can even try it here. – Sk8erPeter Dec 27 '11 at 20:12
  • another useful jQuery plugin: **Truncatable**: http://theodin.co.uk/blog/development/truncatable-jquery-plugin.html – Sk8erPeter Dec 27 '11 at 20:26
5

Badonkatrunc supports nested content in a non-destructive manner.

(Full disclosure: I am the developer of the plugin.)

Joel Day
  • 1,917
  • 1
  • 16
  • 12
1

Truncate plugin is good, but for my use it didn't handle p tags well enough for the read more link to reside inline.

I found success with this one: http://henrik.nyh.se/2008/02/jquery-html-truncate