Sha256: 6e578f8e5d54e8092d810130e4104a04722a7b820577f6b717e60f6b7960bc41
Contents?: true
Size: 679 Bytes
Versions: 37
Compression:
Stored size: 679 Bytes
Contents
module Nanoc::Helpers # @see http://nanoc.ws/doc/reference/helpers/#text module Text # @param [String] string # @param [Number] length # @param [String] omission # # @return [String] def excerptize(string, length: 25, omission: '...') if string.length > length excerpt_length = [0, length - omission.length].max string[0...excerpt_length] + omission else string end end # @param [String] string # # @return [String] def strip_html(string) # FIXME: will need something more sophisticated than this, because it sucks string.gsub(/<[^>]*(>+|\s*\z)/m, '').strip end end end
Version data entries
37 entries across 37 versions & 1 rubygems