Skip to content

AndrewRayCode/ct-truncate

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

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