11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/kitchen/directions/bake_chapter_title/v1.rb', line 11
def fix_up_chapter_title(chapter:)
heading = chapter.at('h1[2]')
heading[:id] = "chapTitle#{chapter.count_in(:book)}"
heading.replace_children(with:
" <span class=\"os-part-text\">\#{I18n.t(:chapter)} </span>\n <span class=\"os-number\">\#{chapter.count_in(:book)}</span>\n <span class=\"os-divider\"> </span>\n <span data-type=\"\" itemprop=\"\" class=\"os-text\">\#{heading.text}</span>\n HTML\n )\nend\n"
|