From 5fb49b575a548313b827fd66fd7ecce514fe0e45 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 6 Jan 2014 23:02:50 -0500 Subject: v5: heading recalibration, code (downstream) changes * here no doubt remains breakage (test, fix & test again) --- lib/sisu/v5/html_minitoc.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'lib/sisu/v5/html_minitoc.rb') diff --git a/lib/sisu/v5/html_minitoc.rb b/lib/sisu/v5/html_minitoc.rb index 65cfe91a..dae74c46 100644 --- a/lib/sisu/v5/html_minitoc.rb +++ b/lib/sisu/v5/html_minitoc.rb @@ -89,6 +89,7 @@ gsub(@pat_strip_heading_name,'\1') #gsub(/(.*?)<\/a>(.*)/,'\1') #2002w42 altered gsub - problematic? - suspect toc=case txt.ln + when 0 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_0 when 1 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_1 when 2 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_2 when 3 then SiSU_HTML_MiniToc::TocMini.new(@md,txt).level_3 @@ -115,6 +116,18 @@ format_head_toc=SiSU_HTML_Format::HeadToc.new(@d0c) @@seg_mini << format_head_toc.mini_concordance end + def level_0 + txt=@data + if (txt.is ==:heading \ + || txt.is ==:heading_insert) \ + && txt.ocn !=0 + txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1') + end + txt_obj={ txt: txt.obj } + format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) + toc_mini=format_toc.mini_lev0 + toc_mini + end def level_1 txt=@data if (txt.is ==:heading \ @@ -122,7 +135,7 @@ && txt.ocn !=0 txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1') end - title=unless txt.obj =~/Document Information/; txt.obj + title=unless txt.obj =~/Document Information/ then txt.obj else link='metadata' %{#{txt.obj}} -- cgit v1.2.3