Navigation Menu

Skip to content

AndrewRayCode/ct-truncate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 

Repository files navigation

CT Truncate Plugin

Truncate rich text and keep all links and unicode characters in tact, without effing up the DOM!

<div id="foo">
    I am some <p>rich text</p>
    <span>that needs <a href="http://www.google.com">truncating!</a></span>
</div>

Usage:

$('#foo').ctTruncate({
    
    // Characters to truncate at
    maxChars: 30,

    // The text to append after the text is truncated. Defaults to elipses.
    truncator: '\u2026',
});

Then party till you're blind!

About

Truncate rich text (or regular text) with this jQuery plugin!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published