From 08c69d074001507d64cd5960c8679ec91a5a8353 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 23 Aug 2008 12:01:59 -0400 Subject: pass Hash to Format classes; some match tuning in dal --- lib/sisu/v0/html_scroll.rb | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v0/html_scroll.rb') diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb index 01720862..9286df10 100644 --- a/lib/sisu/v0/html_scroll.rb +++ b/lib/sisu/v0/html_scroll.rb @@ -102,13 +102,16 @@ module SiSU_HTML_scroll unless para =~/^#{Mx[:gr_o]}code#{Mx[:gr_c]}/; para.gsub!(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]}).+?(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})\s*/m,' ') end if para =~/.+?#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - paranum=para[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/,1] - @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,paranum) + ocn=para[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/,1] + @p_num=SiSU_HTML_Format::Paragraph_number.new(@md,ocn) end @sto=SiSU_HTML::Source::Split_text_object.new(@md,para).html_scroll m=/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ if para =~m - format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|ordinary/ #watch + if @sto.format =~/i[1-9]|ordinary/ #watch + txt_obj={:txt =>@sto.text} + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) + end case @sto.format when /^1:\S*?/; para=@sto.scroll_lev_para_ocn.heading_body1 when /^2:\S*?/; para=@sto.scroll_lev_para_ocn.heading_body2 @@ -139,30 +142,33 @@ module SiSU_HTML_scroll end elsif para =~/^#{Mx[:lv_o]}[1-9]:/ \ and para !~/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_c]}#@dp:#@dp#{Mx[:id_c]}$/ - format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,para) + txt_obj={:txt =>para} + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) para=format_txt_obj.bold_header elsif para =~/Endnotes?/ \ and para !~/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,'
Note') + txt_obj={:txt =>'
Note'} + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) para=format_txt_obj.bold_para elsif para =~/Owner Details/ \ and para !~/#{Mx[:id_o]}~\d+;(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}$/ - format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,'
Owner Details') + txt_obj={:txt =>'
Owner Details'} + format_txt_obj=SiSU_HTML_Format::Format_text_object.new(@md,txt_obj) @scr[:owner_details]=format_txt_obj.bold_para para='' elsif para =~/(.*)#{Mx[:id_o]}~0;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}(.*)/ #watch - one,two=$1,$2 - format_seg=SiSU_HTML_Format::Format_seg.new(@md,one,two) + cont=if $2.empty? + $1 + else "#{$1} #{$2}" #watch, check desired where $2 is other than space + end + txt_obj={:txt =>cont} + format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) para=format_seg.no_paranum end if para =~// \ and para =~/^(?:\^~\d+\s|)/ # hmmm re-adjusted 200507, for alt endnote which should again be matched ^~ ... not in response to problem though para='' end - if para =~/<:center>/ #rules changed now a

(.*)/.match(para).captures - format_scroll=SiSU_HTML_Format::Format_scroll.new(@md,one,two) - end para.gsub!(/^#{Rx[:mx_fa_clean]}/,' '); para.gsub!(/^<:\S?>/,'') para.gsub!(/#{Rx[:mx_fa_clean]}/,' '); para.gsub!(/<:\S?>/,' '); para.gsub!(//,' ') para.strip! -- cgit v1.2.3