aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/current/ao_endnotes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/current/ao_endnotes.rb')
-rw-r--r--lib/sisu/current/ao_endnotes.rb15
1 files changed, 7 insertions, 8 deletions
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 <!e(\d)!> <!e_(\d)!> -->
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 /^(<!e[:_]!>|[-~]\{{3})/ (in earlier loop)
+ when /~\^(?:\s|$)/ #%note inserts endnotes previously gathered from /^(<!e[:_]!>|[-~]\{{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