From 1323f18af45ea0d3aaef5cd9ead0efb5de8b9729 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 19 Apr 2015 14:44:38 -0400 Subject: c<-d: sync, roll develop into current dir branch (5==6) * two dir branches, same library contents (v5 synced & updated with v6) --- lib/sisu/current/ao_endnotes.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/sisu/current/ao_endnotes.rb') diff --git a/lib/sisu/current/ao_endnotes.rb b/lib/sisu/current/ao_endnotes.rb index 7c9ae067..508d798a 100644 --- a/lib/sisu/current/ao_endnotes.rb +++ b/lib/sisu/current/ao_endnotes.rb @@ -66,9 +66,8 @@ module SiSU_AO_Endnotes end def endnotes data=@data - @tuned_file=[] endnote_ref=1 - data.each do |dob| + @tuned_file=data.each.map do |dob| # manually numbered endnotes --> if @md.opt.selections.str =~/--no-asterisk|--no-annotate/ dob.obj=dob.obj. @@ -89,20 +88,20 @@ module SiSU_AO_Endnotes word_mode=endnote_call_number(word_mode) dob.obj=word_mode.join(' ') endnote_ref+=1 - when /~\^(?:\s|$)|<:e>/ #%note inserts endnotes previously gathered from /^(|[-~]\{{3})/ (in earlier loop) + when /~\^(?:\s|$)/ #%note inserts endnotes previously gathered from /^(|[-~]\{{3})/ (in earlier loop) word_mode=dob.obj.scan(/\S+/m) word_mode=endnote_call_number(word_mode) dob.obj=word_mode.join(' ') endnote_ref+=1 end end - @tuned_file << dob - end + dob + end.flatten @endnote_counter, @endnote_counter_asterisk, @endnote_counter_dag= 1,1,1 - @tuned_file=@tuned_file.flatten + @tuned_file end def endnote_call_number(words) words.each do |word| @@ -123,9 +122,9 @@ module SiSU_AO_Endnotes "#{Mx[:en_b_o]}\*#{@endnote_counter_asterisk} ") @endnote_counter_asterisk+=1 end - when /~\^|<:e>/ + when /~\^/ if @endnote_array - word.gsub!(/~\^|<:e>/, + word.gsub!(/~\^/, "#{@endnote_array[@endnote_counter-1]}") @endnote_counter+=1 end -- cgit v1.2.3