From d43865fb6a093625a77e8605d6fb00158546e1e4 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 12 Aug 2008 23:37:42 -0400 Subject: html increased use of css; dal, middle layer, url representation, interim commit --- lib/sisu/v0/dal.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/sisu/v0/dal.rb') diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb index cb6d70f8..cf6d8e09 100644 --- a/lib/sisu/v0/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -257,7 +257,7 @@ module SiSU_DAL when /\^~/ # endnotes #% Note must do this first (earlier loop) and then enter gathered data into ~^\d+ sub_para=para.dup - @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/, %{#{Mx[:en_a_o]}#{endnote_no} \\1 #{Mx[:en_a_c]}}).strip + @@endnote_array << sub_para.gsub!(/\n/,'').gsub!(/\^~\s+(.+)\s*/,%{#{Mx[:en_a_o]}#{endnote_no} \\1 #{Mx[:en_a_c]}}).strip endnote_no+=1 para=nil if para =~/\^~ .+/ #removes 'binary' endnote now in endnote array for later insertion end @@ -275,9 +275,9 @@ module SiSU_DAL end data.each do |para| para.strip! - if para =~/\{\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?\}(?:(?:https?|file|ftp):\S+|image)/ - if para !~/\{\s*\S+\.(?:png|jpg|gif)\s+\d+x\d+\s+/ - m=/\{\s*(\S+\.(?:png|jpg|gif))/ + if para =~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)(?:\s*|\s+.+)?#{Mx[:lnk_c]}(?:(?:https?|file|ftp):\S+|image)/ + if para !~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif)\s+\d+x\d+\s+/ + m=/#{Mx[:lnk_o]}\s*(\S+\.(?:png|jpg|gif))/ if @rmgk imgs=para.scan(m).flatten images=imgs.each do |image| @@ -306,7 +306,7 @@ module SiSU_DAL end end para.gsub!(/(#{image})/,"#{image} #{img_col}x#{img_row}") - else para.gsub!(/\{\s*(\S+)\.(png|jpg|gif).+?\}((?:https?|file|ftp):\S+|image)/,'[ \1 (\2 missing) ]') + else para.gsub!(/#{Mx[:lnk_o]}\s*(\S+)\.(png|jpg|gif).+?#{Mx[:lnk_c]}((?:https?|file|ftp):\S+|image)/,'[ \1 (\2 missing) ]') end end else @@ -317,7 +317,7 @@ module SiSU_DAL end end end - para.gsub!(/\{\s+(\S+\.(?:png|jpg|gif))\s+/i,'{\1 ') if para =~/\{\s+\S+\.(?:png|jpg|gif).+?\}(?:(?:https?|file|ftp):\S+|image)/ + para.gsub!(/(#{Mx[:lnk_o]})\s*(\S+\.(?:png|jpg|gif))\s+/i,'\1\2 ') if para =~/#{Mx[:lnk_o]}\s*\S+\.(?:png|jpg|gif).+?#{Mx[:lnk_c]}(?:(?:https?|file|ftp):\S+|image)/ tuned_file << para unless para.nil? end tuned_file @@ -1147,7 +1147,7 @@ module SiSU_DAL #s=s.gsub(/¡¡\d+¡/,' ') # tables #s=s.gsub(/¡/,' ') # tables tidy later #s=s.gsub(/<.+?>/,'') - s=s.gsub(/\{.+?\.(?:png|jpg|gif).+?\}(?:https?|file|ftp)\\\:\S+ /,' [image] ') # else image names found in search + s=s.gsub(/#{Mx[:lnk_o]}.+?\.(?:png|jpg|gif).+?#{Mx[:lnk_c]}(?:https?|file|ftp)\\\:\S+ /,' [image] ') # else image names found in search s=s.gsub(/\s\s+/,' ') s=s.strip end -- cgit v1.2.3