diff options
author | Ralph Amissah <ralph@amissah.com> | 2008-08-23 22:12:15 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2008-08-23 22:12:15 -0400 |
commit | 2a93f7b9fa048ffba2692cf53c407a943f54505c (patch) | |
tree | b2e75ed336603dac103a49d77ca37b230932d013 /lib/sisu/v0/odf.rb | |
parent | pass Hash to Format classes; some match tuning in dal (diff) |
minitoc added to concordance and manifest; dal, precision in endnote matching
Diffstat (limited to 'lib/sisu/v0/odf.rb')
-rw-r--r-- | lib/sisu/v0/odf.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/sisu/v0/odf.rb b/lib/sisu/v0/odf.rb index d21a8628..03a94ce6 100644 --- a/lib/sisu/v0/odf.rb +++ b/lib/sisu/v0/odf.rb @@ -128,7 +128,7 @@ module SiSU_ODF end # Used for extraction of endnotes from paragraphs def extract_endnotes(para='') - notes=para.scan(/#{Mx[:en_a_o]}(\d+\s+.+?)\s*#{Mx[:id_o]}#@dp#{Mx[:id_c]}#{Mx[:en_a_c]}/) + notes=para.scan(/#{Mx[:en_a_o]}(\d+\s+.+?)\s*#{Mx[:id_o]}#@dp#{Mx[:id_c]}#{Mx[:en_a_c]}/)[1] @n=[] notes.each do |n| #high cost to deal with <br> appropriately within odf, consider n=n.dup.to_s @@ -283,24 +283,24 @@ module SiSU_ODF end def footnote(para) @astx||=10000 - para.gsub!(/#{Mx[:id_o]}#@dp#{Mx[:id_c]}(#{Mx[:en_a_c]}|#{Mx[:en_a_c]})/,'\1') + para.gsub!(/#{Mx[:id_o]}#@dp#{Mx[:id_c]}(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/,'\1') #para.gsub!(/<br \/><:i[1-9]>/,'<br />') - if para =~/#{Mx[:en_a_o]}\d+\s+/ + if para =~/#{Mx[:en_a_o]}\d+\s+/ para=para.gsub(/#{Mx[:en_a_o]}(\d+)\s+(.+?)#{Mx[:en_a_c]}/,'<text:note text:id="ftn\1" text:note-class="footnote"><text:note-citation>\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>') end - if para=~/#{Mx[:en_b_o]}[*+]\d+\s/ #editor notes, squre bracket series - asterisk=para.scan(/#{Mx[:en_b_o]}([*+]\d+)\s+(.+?)#{Mx[:en_b_c]}/) + if para=~/#{Mx[:en_a_o]}[*+]+\s/ + asterisk=para.scan(/#{Mx[:en_a_o]}([*+]+)\s+(.+?)#{Mx[:en_a_c]}/) asterisk.each do |x| a=x[0].gsub(/([*+])/,"\\\\\\1") - para=para.gsub(/#{Mx[:en_b_o]}(#{a})\s+(.+?)#{Mx[:en_b_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) + para=para.gsub(/#{Mx[:en_a_o]}(#{a})\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) @astx+=1 end end - if para=~/#{Mx[:en_a_o]}[*+]+\s/ - asterisk=para.scan(/#{Mx[:en_a_o]}([*+]+)\s+(.+?)#{Mx[:en_a_c]}/) + if para=~/#{Mx[:en_b_o]}[*+]\d+\s/ + asterisk=para.scan(/#{Mx[:en_b_o]}([*+]\d+)\s+(.+?)#{Mx[:en_b_c]}/) asterisk.each do |x| a=x[0].gsub(/([*+])/,"\\\\\\1") - para=para.gsub(/#{Mx[:en_a_o]}(#{a})\s+(.+?)#{Mx[:en_a_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) + para=para.gsub(/#{Mx[:en_b_o]}(#{a})\s+(.+?)#{Mx[:en_b_c]}/,%{<text:note text:id="ftn#{@astx.to_s}" text:note-class="footnote"><text:note-citation text:label="\\1">\\1</text:note-citation><text:note-body><text:p text:style-name="Footnote"> \\2</text:p><text:p text:style-name="Footnote"/></text:note-body></text:note>}) @astx+=1 end end |