Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 521 Bytes

html_slicer.md

File metadata and controls

19 lines (11 loc) · 521 Bytes

html_slicer

Split HTML text in 2 paragraphs using addagger/html_slicer

Gemfile

gem 'html_slicer', :require => nil

Usage

complement = Complement.find(2615160)
content = complement.value

sliced = HtmlSlicer::Interface.new(content, :to_s, { :slice => { :complete => /\s+|\z/, :maximum => content.dehtml.length/10 } })

sliced.to_s

sliced.slice!(2)
sliced.to_s