diff options
author | Ralph Amissah <ralph@amissah.com> | 2012-02-03 20:45:52 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2012-02-03 20:45:52 -0500 |
commit | 7db7a01a7d86e95159bdef47162dc180accf1acb (patch) | |
tree | 156013cdb28b483ac122c26b9f2e199c9a7d9d12 /lib/sisu/v3dv/html_minitoc.rb | |
parent | debian/changelog (3.1.12-1) (diff) | |
parent | v3dv, dal +, use symbols to identify document objects type (is) and group (of) (diff) |
Merge tag 'sisu_3.1.13' into debian/sid
Diffstat (limited to 'lib/sisu/v3dv/html_minitoc.rb')
-rw-r--r-- | lib/sisu/v3dv/html_minitoc.rb | 23 |
1 files changed, 14 insertions, 9 deletions
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(/<a name="-\d+" href="#_\d+"> <sup>\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={} |