From 591d76666b85e0e211b273c71e79844fe813a315 Mon Sep 17 00:00:00 2001 From: Hendrik Kleinwaechter Date: Sat, 19 Aug 2023 14:34:23 +0200 Subject: [PATCH] Fix menu numbers not listing subchapters --- website/modify_build.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/modify_build.rb b/website/modify_build.rb index 0d5fbaa..686f76e 100644 --- a/website/modify_build.rb +++ b/website/modify_build.rb @@ -104,7 +104,7 @@ class ModifyBuild doc = build_doc(text) elements = [doc.search('.chapterToc'), doc.search('.sectionToc'), doc.search('.subsectionToc')].flatten elements.each do |n| - chapter_number_or_nothing = n.children[0].text.strip.to_i + chapter_number_or_nothing = n.children[0].text.strip.gsub(/[[:space:]]/, '') hyperlink_node = n.children[1] next if hyperlink_node.nil? @@ -112,9 +112,10 @@ class ModifyBuild n.children[0].remove link_text = hyperlink_node.content # no chapter number - if chapter_number_or_nothing == 0 + if chapter_number_or_nothing == "" content = hyperlink_node.to_s else + #binding.pry if link_text == "The process" link_node_content = %Q{ #{chapter_number_or_nothing} #{link_text}