{"id":3303,"date":"2019-11-27T14:01:00","date_gmt":"2019-11-27T14:01:00","guid":{"rendered":"https:\/\/azoora.com\/blog\/?p=3303"},"modified":"2019-11-28T14:20:05","modified_gmt":"2019-11-28T14:20:05","slug":"shave-multiline-text-truncate-plugin-for-javascript","status":"publish","type":"post","link":"https:\/\/azoora.com\/blog\/code\/shave-multiline-text-truncate-plugin-for-javascript\/","title":{"rendered":"Shave: Multiline Text Truncate Plugin for JavaScript"},"content":{"rendered":"\n<p><a href=\"https:\/\/github.com\/dollarshaveclub\/shave\">Shave<\/a> is a zero dependency javascript plugin that truncates multi-line text to fit within an html element based on a set max-height. It then stores the diff of the original text string in a hidden &lt;span> element following the visible text. This means the original text remains intact!<\/p>\n\n\n\n<p>This JavaScript plugin has been coded and released by\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/www.dollarshaveclub.com\/\" target=\"_blank\">Dollar Shave Club<\/a>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><strong>Demo<\/strong>: <a href=\"http:\/\/codepen.io\/yowainwright\/pen\/VKVXRa\">Plain JS on Codepen<\/a>, <a href=\"http:\/\/codepen.io\/yowainwright\/pen\/c35ad7a281bc58ce6f89d2adb94c5d14\/\">jQuery or Zepto on Codepen<\/a><\/p><p><strong>Download<\/strong>: <a href=\"https:\/\/github.com\/dollarshaveclub\/shave\">GitHub<\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Shave is a zero dependency javascript plugin that truncates multi-line text to fit within an html element based on a set max-height. It then stores the diff of the original text string in a hidden &lt;span> element following the visible text. This means the original text remains intact! This JavaScript plugin has been coded and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":3304,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[4,145,12],"tags":[25,146,87,54],"jetpack_featured_media_url":"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/11\/Shave.Js.jpg","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p7FQPL-Rh","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/3303"}],"collection":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/comments?post=3303"}],"version-history":[{"count":1,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/3303\/revisions"}],"predecessor-version":[{"id":3305,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/3303\/revisions\/3305"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media\/3304"}],"wp:attachment":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media?parent=3303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/categories?post=3303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/tags?post=3303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}