aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/ao_numbering.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v6/ao_numbering.rb')
-rw-r--r--lib/sisu/v6/ao_numbering.rb43
1 files changed, 33 insertions, 10 deletions
diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb
index 0dbb1a71..791f5bfc 100644
--- a/lib/sisu/v6/ao_numbering.rb
+++ b/lib/sisu/v6/ao_numbering.rb
@@ -121,7 +121,8 @@ module SiSU_AO_Numbering
dob
end
def heading_tag_clean(heading_tag)
- heading_tag=heading_tag.gsub(/[ ]+/,'_').
+ heading_tag=heading_tag.
+ gsub(/[ ]+/,'_').
gsub(/["']/,'').
gsub(/[\/]/,'-').
gsub(/#{Mx[:fa_bold_o]}|#{Mx[:fa_bold_c]}/,'').
@@ -315,7 +316,8 @@ module SiSU_AO_Numbering
if dob.name !~/^\S+/ \
and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numerical construct, use that as name
possible_seg_name=$1
- possible_seg_name=possible_seg_name.gsub(/(?:[:,-]|\W)/,'.').
+ possible_seg_name=possible_seg_name.
+ gsub(/(?:[:,-]|\W)/,'.').
gsub(/\.$/,'')
if @md.seg_names.is_a?(Array) \
and not @md.seg_names.include?(possible_seg_name)
@@ -363,11 +365,17 @@ module SiSU_AO_Numbering
m=dob.ln.to_s
dob_tmp=[]
if @md.pagenew.inspect =~/#{m}/
- dob_tmp << SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new]) << dob
+ dob_tmp <<
+ SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_new]) <<
+ dob
elsif @md.pagebreak.inspect =~/#{m}/
- dob_tmp << SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page]) << dob
+ dob_tmp <<
+ SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page]) <<
+ dob
elsif @md.pageline.inspect =~/#{m}/
- dob_tmp << SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_line]) << dob
+ dob_tmp <<
+ SiSU_AO_DocumentStructure::ObjectLayout.new.break(Hx[:br_page_line]) <<
+ dob
end
unless dob_tmp.length > 0; dob
else dob_tmp
@@ -381,11 +389,23 @@ module SiSU_AO_Numbering
: @segname
tags["#{dob.ocn}"]={ segname: @segname }
ocn_html_seg[dob.ocn]=if (dob.is==:heading || dob.is==:heading_insert)
- if dob.ln =~/[0-3]/ then { seg: nil, level: dob.ln }
+ if dob.ln =~/[0-3]/
+ {
+ seg: nil,
+ level: dob.ln,
+ }
#elsif dob.ln =~/[4-6]/
- else { seg: @seg, level: dob.ln }
+ else
+ {
+ seg: @seg,
+ level: dob.ln,
+ }
end
- else { seg: @seg, level: nil }
+ else
+ {
+ seg: @seg,
+ level: nil,
+ }
end
end
dob.tags=dob.tags.uniq if defined? dob.tags
@@ -434,7 +454,9 @@ module SiSU_AO_Numbering
and defined? @md.title.full \
and defined? @md.creator \
and @md.creator
- head=@md.title.main ? ([@lv='1',@obj=@md.title.main]) : ([@lv='1',@obj='[no title provided]'])
+ head=@md.title.main \
+ ? ([@lv='1',@obj=@md.title.main])
+ : ([@lv='1',@obj='[no title provided]'])
@tuned_file << head
end
end
@@ -479,7 +501,8 @@ module SiSU_AO_Numbering
unless @md.set_header_title
if t_o !~/^%{1,2}\s/m \
and t_o !~/\A\s*\Z/m
- @tuned_file << "#{Mx[:meta_o]}title#{Mx[:meta_c]} #{@md.heading_seg_first}"
+ @tuned_file <<
+ "#{Mx[:meta_o]}title#{Mx[:meta_c]} #{@md.heading_seg_first}"
@md.title.main=@md.heading_seg_first
@md.set_header_title=true
end