From 7e3cee576368c095fe491014bd279eb280c598ba Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 3 Feb 2012 20:41:32 -0500 Subject: v3dv, dal +, use symbols to identify document objects type (is) and group (of) * (dal & code affected as a result) --- lib/sisu/v3dv/html_minitoc.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lib/sisu/v3dv/html_minitoc.rb') diff --git a/lib/sisu/v3dv/html_minitoc.rb b/lib/sisu/v3dv/html_minitoc.rb index d70fa7e1..729eee50 100644 --- a/lib/sisu/v3dv/html_minitoc.rb +++ b/lib/sisu/v3dv/html_minitoc.rb @@ -74,7 +74,8 @@ toc=nil @toc=[] @data.each do |txt| - if (txt.is =='heading' or txt.is =='heading_insert') + if txt.is ==:heading \ + || txt.is ==:heading_insert txt.obj=txt.obj.gsub(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,''). #remove endnotes from toc gsub(/ \d+<\/sup> <\/a>/,''). gsub(@pat_strip_heading_name,'\1') @@ -108,8 +109,9 @@ end def level_1 txt=@data - if (txt.is =='heading' or txt.is =='heading_insert') \ - and txt.ocn !=0 + if (txt.is ==:heading \ + || txt.is ==:heading_insert) \ + && txt.ocn !=0 txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1') end title=unless txt.obj =~/Document Information/; txt.obj @@ -128,8 +130,9 @@ end def level_2 txt=@data - if (txt.is =='heading' or txt.is =='heading_insert') \ - and txt.ocn !=0 + 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 } @@ -165,8 +168,9 @@ end def level_5 txt=@data - if (txt.is =='heading' or txt.is =='heading_insert') \ - and txt.ocn !=0 + if (txt.is ==:heading \ + || txt.is ==:heading_insert) \ + && txt.ocn !=0 txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1') end toc={} @@ -180,8 +184,9 @@ end def level_6 txt=@data - if (txt.is =='heading' or txt.is =='heading_insert') \ - and txt.ocn !=0 + if (txt.is ==:heading \ + || txt.is ==:heading_insert) \ + && txt.ocn !=0 txt.obj=txt.obj.gsub(@pat_strip_heading_name,'\1') end toc={} -- cgit v1.2.3