Last active
November 29, 2015 14:29
-
-
Save AllThingsSmitty/0ca5416f26493076a993 to your computer and use it in GitHub Desktop.
Apply ellipsis to the end of content that has more than 300 characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (content.length > 300) { | |
// truncate to a shorter text length | |
return content.substring(0, 200) + '...'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment