Module: Kitchen::Directions::BakeInlineLists

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

Overview

Bakes inline lists with the desired list separator Does not separate the last list item

Constant Summary collapse

LIST_SEPARATOR =
'; '
SEPARATOR_CLASS =
'-os-inline-list-separator'

Class Method Summary collapse

Class Method Details

.v1(book:) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/kitchen/directions/bake_inline_lists.rb', line 12

def self.v1(book:)
  inline_lists = book.search('span[data-display="inline"][data-list-type="labeled-item"]')
  inline_lists.each do |list|
    list.search('span[data-type="item"]')[0..-2].each do |item|
      item.append(child: "<span class=\"#{SEPARATOR_CLASS}\">#{LIST_SEPARATOR}</span>")
    end
  end
end