aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/dal.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-08-23 22:12:15 -0400
committerRalph Amissah <ralph@amissah.com>2008-08-23 22:12:15 -0400
commit2a93f7b9fa048ffba2692cf53c407a943f54505c (patch)
treeb2e75ed336603dac103a49d77ca37b230932d013 /lib/sisu/v0/dal.rb
parentpass 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/dal.rb')
-rw-r--r--lib/sisu/v0/dal.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb
index 3187a538..a8bf1cd0 100644
--- a/lib/sisu/v0/dal.rb
+++ b/lib/sisu/v0/dal.rb
@@ -237,7 +237,7 @@ module SiSU_DAL
para.gsub!(/<~#>|~#\s*/,"#{Mx[:fa_o]}~##{Mx[:fa_c]}")
para.gsub!(/-#\s*/,"#{Mx[:fa_o]}-##{Mx[:fa_c]}#{Mx[:fa_o]}~##{Mx[:fa_c]}")
#para.gsub!(/(#\{{3} arch-tag:|0\{{3}~cvs)\s+/, "0{{~rcs ") #KEEP ... ENABLE WIDER USE OF REVISION CONTROL
- para.gsub!(/(#{Mx[:en_a_o]} )\s+/,'\1'); para.gsub!(/(~\{ )\s+/,'\1')
+ para.gsub!(/(#{Mx[:en_a_o]})\s*/,'\1 '); para.gsub!(/(~\{\s*)\s+/,'\1 ')
para.gsub!(/ \/\//,"#{Mx[:br_line]}") #added 2004w29
para.gsub!(/<br>/,"#{Mx[:br_line]}") #needed by xml, xhtml etc.
#para.gsub!(/<p>/,'<p />') #consider
@@ -852,7 +852,7 @@ module SiSU_DAL
unless para =~/^#{Mx[:gr_o]}code#{Mx[:gr_c]}/
case para
# auto-numbered endnotes <!e!> <!e_!> -->
- when /#{Mx[:en_a_o]}\s+.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}[*+]\s+.+?#{Mx[:en_b_c]}/
+ when /#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}[*+].+?#{Mx[:en_b_c]}/
para.gsub!(/\s*(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/,' \1') # required 2003w31
word_mode=para.scan(/#{Mx[:gr_o]}group#{Mx[:gr_c]}\n|\n#{Mx[:gr_o]}group-end#{Mx[:gr_c]}|\S+/m)
word_mode=endnote_call_number(word_mode)
@@ -876,15 +876,15 @@ module SiSU_DAL
case word
when /#{Mx[:en_a_o]}/
unless word =~/#{Mx[:en_a_o]}[*+]+/
- word.gsub!(/#{Mx[:en_a_o]}/,"#{Mx[:en_a_o]}#{@@endnote_counter} ")
+ word.gsub!(/#{Mx[:en_a_o]}/,"#{Mx[:en_a_o]}#{@@endnote_counter}")
@@endnote_counter+=1
end
when /#{Mx[:en_b_o]}/
if word =~/#{Mx[:en_b_o]}[+]/
- word.gsub!(/#{Mx[:en_b_o]}[+]/,"#{Mx[:en_b_o]}\+#{@@endnote_counter_dag} ")
+ word.gsub!(/#{Mx[:en_b_o]}[+]/,"#{Mx[:en_b_o]}\+#{@@endnote_counter_dag}")
@@endnote_counter_dag+=1
else
- word.gsub!(/#{Mx[:en_b_o]}[*]?/,"#{Mx[:en_b_o]}\*#{@@endnote_counter_asterisk} ")
+ word.gsub!(/#{Mx[:en_b_o]}[*]?/,"#{Mx[:en_b_o]}\*#{@@endnote_counter_asterisk}")
@@endnote_counter_asterisk+=1
end
when /~\^|<:e>/
@@ -1127,7 +1127,7 @@ module SiSU_DAL
end
def strip_clean_extra_spaces(s) # dal output tuned
s=s.dup
- s=s.gsub(/[ ]+([,.;:?](?:$|\s))/,'\1')
+ s=s.gsub(/[ ]+([,.;:?](?:$|\s))/,'\1') unless s =~/#{Mx[:en_a_o]}|#{Mx[:en_b_o]}/
s=s.gsub(/ [ ]+/,' ')
s=s.gsub(/^ [ ]+/,'')
s=s.gsub(/ [ ]+$/,'')