diff options
Diffstat (limited to 'lib/sisu/v0/html_scroll.rb')
| -rw-r--r-- | lib/sisu/v0/html_scroll.rb | 36 | 
1 files changed, 22 insertions, 14 deletions
| diff --git a/lib/sisu/v0/html_scroll.rb b/lib/sisu/v0/html_scroll.rb index 0bbac4fa..3e72f855 100644 --- a/lib/sisu/v0/html_scroll.rb +++ b/lib/sisu/v0/html_scroll.rb @@ -87,6 +87,7 @@ module SiSU_HTML_scroll          #if para =~/^#{Mx[:lv_o]}\d:endnotes#{Mx[:lv_c]}\s*Endnotes/          ##  para.gsub!(/Endnotes.+/,'')          #end +        para='' if para =~/#{Mx[:lv_o]}\d+:.*?#{Mx[:lv_c]}.+?#{Mx[:pa_non_object_dummy_heading]}/          if para =~/^#{Mx[:lv_o]}\d:meta#{Mx[:lv_c]}\s*Document Information/            para.gsub!(/(Document Information(?: \(metadata\))?)/,'\1<a name="docinfo"></a>')          end @@ -97,17 +98,21 @@ module SiSU_HTML_scroll          and (para =~/^#{Mx[:lv_o]}:metadata#{Mx[:lv_c]}/ or para =~/^#{Mx[:lv_o]}1:meta#{Mx[:lv_c]}\s*Document Information/)            @rcdc=true          end +        para.gsub!(/(?:\s*#{Mx[:br_page]}\s*|\s*#{Mx[:br_page_new]}\s*)+/m,'<p><hr width=90% /></p>')          if para !~/(^#{Rx[:meta]}|#{Mx[:br_endnotes]}|#{Mx[:br_eof]})/            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_type::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_type::Format_text_object.new(@md,@sto.text) if @sto.format =~/i[1-9]|null/ #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 @@ -126,7 +131,7 @@ module SiSU_HTML_scroll              when /^(?:b|bold)$/;           para=@sto.scroll_lev_para_ocn.bold              when /^(?:verse|group|alt)$/;  para=@sto.scroll_lev_para_ocn.para              when /^code$/;                 para=@sto.scroll_lev_para_ocn.code -            when /null/ # see whether u can improve +            when /ordinary/ # see whether u can improve                if para !~/#{@vz.margin_txt_0}|#{@vz.margin_txt_1}|#{@vz.margin_txt_2}/                  format_txt_obj.gsub_body                  para=@sto.scroll_lev_para_ocn.para @@ -138,30 +143,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_type::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_type::Format_text_object.new(@md,'<br /><a name="notes">Note</a>') +            txt_obj={:txt =>'<br /><a name="notes">Note</a>'} +            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_type::Format_text_object.new(@md,'<br /><a name="owner.details">Owner Details</a>') +            txt_obj={:txt =>'<br /><a name="owner.details">Owner Details</a>'} +            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_type::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 =~/<a name="n\d+">/ \            and para =~/^(?:\^~\d+\s|<!e[:_]\d+!>)/ # 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 <p class="center" problems may arise 2005w11 ! -            one,two=/(.*)<:center>(.*)/.match(para).captures -            format_scroll=SiSU_HTML_Format_type::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! @@ -174,7 +182,7 @@ module SiSU_HTML_scroll      end      def tails        scr_tail=[] -      format_head_scroll=SiSU_HTML_Format_type::Head_toc.new(@md) +      format_head_scroll=SiSU_HTML_Format::Head_toc.new(@md)        ads=SiSU_HTML_promo::Ad.new(@md)        scr_tail << format_head_scroll.scroll_tail << ads.div.close << ads.display << format_head_scroll.html_close        scr_tail | 
