hgmnz/truncate_html

View on GitHub
lib/app/helpers/truncate_html_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
module TruncateHtmlHelper

  def truncate_html(html, options={})
    return '' if html.nil?
    html_string = TruncateHtml::HtmlString.new(html)
    TruncateHtml::HtmlTruncator.new(html_string, options).truncate.html_safe
  end

end