truncate_html
truncate_html copied to clipboard
allow to specify at which break token occurance to truncate
Extends :break_token
configuration with :break_token_at_count
which allows to specify at which occurrence of :break_token
to truncate HTML.
Possible use case: truncate first 3 paragraphs.
TruncateHtml.configure do |config|
config.break_token = '</p>'
config.break_token_at_count = 3
end