Sha256: f825023bf19edb64585c09628a3f351f458f360d41b0071a936397843f2a7a43
Contents?: true
Size: 539 Bytes
Versions: 23
Compression:
Stored size: 539 Bytes
Contents
# frozen_string_literal: true module Kitchen::Directions::BakePreface class V1 def bake(book:, title_element:) book.pages('$.preface').each do |page| page.search('div[data-type="description"], div[data-type="abstract"]').each(&:trash) page.titles.each do |title| title.replace_children(with: <<~HTML <span data-type="" itemprop="" class="os-text">#{title.text}</span> HTML ) title.name = title_element end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems