rviscomi / trunk8

jQuery Truncation Plugin -- THIS PROJECT IS NO LONGER MAINTAINED
MIT License
703 stars 95 forks source link

HTML Support for Trunk8 #29

Closed ztratar closed 11 years ago

ztratar commented 11 years ago

Passing in the setting parseHTML as true, will result in the bite data being directly translated to the original strings HTML tags.

ztratar commented 11 years ago

There ya go @vhmth

rviscomi commented 11 years ago

Thanks!! This feature is long overdue and I appreciate the help.

I'll run a battery of tests on it and will merge upon successful completion.

ztratar commented 11 years ago

Absolutely!

I found a couple fixes and will keep my branch up-to-date.

ghost commented 11 years ago

Cool, I didn't realize that I'm on the cutting edge here. I'm seeing this error: Uncaught TypeError: Cannot read property 'original_text' of undefined on line 238 ( /* Get original text. */ var text = $(this).data('trunk8').original_text; ). I'm not even going to try to guess what's up, Just passing along the info.

rviscomi commented 11 years ago

@ztratar This is great. I'm testing on this fiddle: http://jsfiddle.net/rviscomi/uf58P/

Could you add a commit to put the ellipsis (or whatever fill) outside of the truncated HTML? For example, instead of tristi… I'd like to see tristi

Thanks!

ztratar commented 11 years ago

@rviscomi -- Done! I made it dependent upon the tag being wrapped. If we had placed the fill outside of a paragraph tag, for example, it would go to the next line and break the intended # of lines.

Also fixed other bugs with the regex that had to do with punctuation.

rviscomi commented 11 years ago

@ztratar awesome... merged.

Thanks!

ztratar commented 11 years ago

Awesome :]

Let me know if you find any bugs that I should fix.