Module: Kitchen::Directions::BakeListsWithPara

Defined in:
lib/kitchen/directions/bake_lists_with_para.rb

Overview

Bakes lists with paragraphs Should be used for books created by Adaptarr to put list content directly to <li>

Class Method Summary collapse

Class Method Details

.v1(book:) ⇒ Object



9
10
11
12
13
14
# File 'lib/kitchen/directions/bake_lists_with_para.rb', line 9

def self.v1(book:)
  book.search('li').each do |item|
    item_para = item.first('p')&.cut
    item.replace_children with: item_para.children unless item_para.nil?
  end
end