6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/kitchen/directions/bake_stepwise.rb', line 6
def self.v1(book:)
book.search('ol.stepwise').each do |ol|
ol.remove_class('stepwise')
ol.add_class('os-stepwise')
ol.search('> li').each_with_index do |li, ii|
tag = if li.contains_blockish?
'div'
else
'span'
end
li.wrap_children(tag, class: 'os-stepwise-content')
li.prepend(child:
<<~HTML
<span class="os-stepwise-token">#{I18n.t(:stepwise_step_label)} #{ii + 1}. </span>
HTML
)
end
end
end
|