From d29a3e5469d8468084641c385ebf16948f7c2437 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 22 Jul 2008 20:00:59 -0400 Subject: sisu-0.68.0 proposed * middle layer document representation changed, (accounting for substantial patch) * texpdf multiple document sizes as specified in config * numerous small fixes [should on the whole be easier to maintain] --- lib/sisu/v0/html_format.rb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/sisu/v0/html_format.rb') diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb index 525ef50d..03d97a8d 100644 --- a/lib/sisu/v0/html_format.rb +++ b/lib/sisu/v0/html_format.rb @@ -960,7 +960,8 @@ WOK end def endnote_mark %{

-


} #revisit +
+

} #revisit end end class Format_text_object @@ -969,10 +970,10 @@ WOK attr_accessor :md,:one,:two,:three,:parablock,:table,:link,:linkname,:format,:paranum,:p_num,:para_id,:headname,:margin,:paragraph,:table,:banner,:url,:icon,:font,:one_stripped def initialize(md='',*txt) @md,@one,@two,@three=md,txt[0],txt[1],txt[2] - rgx=/^[1-6-]~/ + rgx=/^#{Mx[:lv_o]}\d:\S*?#{Mx[:lv_c]}/ @one_stripped=@one.gsub(rgx,'') if @one =~rgx @dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern - rgx=/~[{\[][\d*+]+\s+(.+?)<#@dp>[}\]]~/ #problem introduced + rgx=/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]})[\d*+]+\s+(.+?)#{Mx[:id_o]}#@dp#{Mx[:id_c]}(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/ #problem introduced @one_stripped=@one.gsub(rgx,'\1') if @one =~rgx #problem introduced @link,@linkname=txt[0],txt[1] @format,parablock=txt[0],txt[1] @@ -989,7 +990,7 @@ WOK @para_id=Paragraph_id_ocn.new(@md,@paranum) #used by table version end @headname='' - if @format =~ /\d~(\S+)/ + if @format=~/^\d:(\S+)/ #need more reliable marker #if @format =~ /#{Rx[:lv]}/ headname=$1 #format[/\d~(\S+)/m,1] @headname=if headname =~/^[a-zA-Z]/; %{} #consider: h_#{headname} else %{} @@ -1045,12 +1046,12 @@ WOK end def gsub_body case @one - when /^(?:<:i[1-9]>\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/ + when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/ @one.gsub!(/^\((i+|iv|v|vi+|ix|x|xi+)\)/,'(\1)') - @one.gsub!(/^(<:i[1-9]>)\s*\((i+|iv|v|vi+|ix|x|xi+)\)/,'\1(\2)') - when /^(?:<:i[1-9]>\s*)?\(?(\d|[a-z])+\)/ + @one.gsub!(/^(#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]})\s*\((i+|iv|v|vi+|ix|x|xi+)\)/,'\1(\2)') + when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\(?(\d|[a-z])+\)/ @one.gsub!(/^\((\d+|[a-z])+\)/,'(\1)') - @one.gsub!(/^(<:i[1-9]>)\s*\((\d+|[a-z])+\)/,'\1(\2)') + @one.gsub!(/^(#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]})\s*\((\d+|[a-z])+\)/,'\1(\2)') when /^\s*\d{1,3}\.\s/ @one.gsub!(/^\s*(\d+\.)/,'\1') when /^\s*[A-Z]\.\s/ @@ -1069,7 +1070,7 @@ WOK def bold_header @one.gsub!(/[1-9]~(\S+)/,'') @one.gsub!(/[1-9]~/,'') - @one.gsub!(/<~0;[um]\d+;[um]\d+><#@dp:#@dp>\s*$/i,'') #watch & do differently + @one.gsub!(/#{Mx[:id_o]}~0;[um]\d+;[um]\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}\s*$/i,'') #watch & do differently %{

#@one

-- cgit v1.2.3