lib/nanoc/helpers/text.rb in nanoc-3.7.4 vs lib/nanoc/helpers/text.rb in nanoc-3.7.5

- old
+ new

@@ -1,12 +1,10 @@ # encoding: utf-8 module Nanoc::Helpers - # Contains several useful text-related helper functions. module Text - # Returns an excerpt for the given string. HTML tags are ignored, so if # you don't want them to turn up, they should be stripped from the string # before passing it to the excerpt function. # # @param [String] string The string for which to build an excerpt @@ -33,12 +31,10 @@ # # @param [String] string The string from which to strip all HTML # # @return [String] The given string with all HTML stripped def strip_html(string) - # FIXME will need something more sophisticated than this, because it sucks + # FIXME: will need something more sophisticated than this, because it sucks string.gsub(/<[^>]*(>+|\s*\z)/m, '').strip end - end - end