aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/html_minitoc.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/html_minitoc.rb')
-rw-r--r--lib/sisu/v3dv/html_minitoc.rb23
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+">&nbsp;<sup>\d+<\/sup>&nbsp;<\/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={}