How to use the prune function from underscore.string
Find comprehensive JavaScript underscore.string.prune code examples handpicked from public code repositorys.
GitHub: ryanlelek/Raneto
22 23 24 25 26 27 28 29 30
config ); const body = marked(content); const title = meta.title ? meta.title : contentProcessors.slugToTitle(slug); const excerpt = _s.prune( _s.stripTags(_s.unescapeHTML(body)), config.excerpt_length || 400 );
449
0
0
81 82 83 84 85 86 87 88 89 90 91 92
exports.truncate = function(value, options, callback){ callback(null, str.truncate(String(value), options[0], typeof options[1] === 'string' ? options[1] : undefined)); }; exports.prune = function(value, options, callback){ callback(null, str.prune(String(value), options[0], typeof options[1] === 'string' ? options[1] : undefined)); }; exports.dateTransform = function(value, options, callback){ var date = moment(value, options[0], true).format(options[1]);
2
2
0
+ 2 other calls in file
GitHub: helenoid/philosophy_blog
25 26 27 28 29 30 31 32 33 34
config ); const body = marked(content); const title = meta.title ? meta.title : contentProcessors.slugToTitle(slug); const excerpt = _s.prune(_s.stripTags(_s.unescapeHTML(body)), (config.excerpt_length || 400)); return { slug, title, body, excerpt }; } catch (e) {
0
1
0
165 166 167 168 169 170 171 172 173 174
return { slug : slug, title : meta.title ? meta.title : this.slugToTitle(slug), body : html, excerpt : _s.prune(_s.stripTags(_s.unescapeHTML(html)), (this.config.excerpt_length || 400)) }; } catch (e) { if (this.config.debug) { console.log(e); } return null;
0
0
2
+ 21 other calls in file
underscore.string.slugify is the most popular function in underscore.string (323 examples)