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/shared_html_lite.rb | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'lib/sisu/v0/shared_html_lite.rb') diff --git a/lib/sisu/v0/shared_html_lite.rb b/lib/sisu/v0/shared_html_lite.rb index 106a56af..a930821e 100644 --- a/lib/sisu/v0/shared_html_lite.rb +++ b/lib/sisu/v0/shared_html_lite.rb @@ -130,15 +130,16 @@ module SiSU_Format_Shared @words=@words.join(' ') end def markup(para) - if para !~/^<:code>/ + if para !~/^#{Mx[:gr_o]}:code#{Mx[:gr_c]}/ if para =~/\{.+?\}((?:https?|file|ftp)\S+|image)/ wm=para.scan(/\{.+?\}(?:(?:https?|file|ftp)\S+|image)|\S+/) words=urls(wm) para.gsub!(/.+/m,words) end + para.gsub!(/#{Mx[:pa_o]}:i[1-9]#{Mx[:pa_c]}/m,'') para.gsub!(/\b[_\\]((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2') #http ftp matches escaped, no decoration para.gsub!(/((?:^|\s)[}])((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?:\s|$))/,'\1\2\3') #special case \{ e.g. \}http://url - para.gsub!(/(^|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3}) #http ftp matches with decoration + para.gsub!(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"><\s]+?)([;.,]?(?=\s|$))/,%{\\1#{@url_brace.xml_open}\\2#{@url_brace.xml_close}\\3}) #http ftp matches with decoration else para.gsub!(/(^|[^}])_/m,'\1>') #code-block: angle brackets special characters para.gsub!(/(^|[^}])_/m,'\1>') @@ -175,13 +176,9 @@ GSUB @content=markup(@content) %{#{@tab*1}

\n#{@tab*2}#@content\n#{@tab*1}

\n} end - def indent1 + def indent(t) @content=markup(@content) - %{#{@tab*1}

\n#{@tab*2}#@content\n#{@tab*1}

\n} - end - def indent2 - @content=markup(@content) - %{#{@tab*1}

\n#{@tab*2}#@content\n#{@tab*1}

\n} + %{#{@tab*1}

\n#{@tab*2}#@content\n#{@tab*1}

\n} end def para_table %{

} @@ -195,40 +192,40 @@ GSUB m=parablock[//,1] @@tablefoot</,'') - @@tablehead=1 if parablock =~//, + @@tablehead=1 if parablock =~/#{Mx[:gr_o]}Th#{Mx[:tc_p]}/u + parablock.gsub!(/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}.+?#{Mx[:tc_p]}~(\d+)#{Mx[:gr_c]}/, #%{

\n} + %{}) - if parablock =~// + if parablock =~/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/ tablefoot=[] @@tablefoot.each {|x| tablefoot << %{

#{x}

\n}} @@tablefoot=[] - parablock.gsub!(//, + parablock.gsub!(/#{Mx[:gr_o]}TZ#{Mx[:gr_c]}/, %{#{@vz.table_close}\n}) # + #%{#{tablefoot}}) end if @@tablehead == 1 - if parablock =~/¡¡/u - parablock.gsub!(/} + %{\n') - @@tablehead=0 #if parablock =~/!>/ + parablock.gsub!(/#{Mx[:tc_c]}/, '') + @@tablehead=0 end parablock else - parablock.gsub!(/} + %{\n') + parablock.gsub!(/#{Mx[:tc_c]}/, '') parablock end @new_content << parablock -- cgit v1.2.3
} + %{#{para_table}}) - parablock.gsub!(/¡¡(\d+?)¡/u, + parablock.gsub!(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, %{} + %{#{para_table}}) - parablock.gsub!(/!>/, '
} + %{#{para_table}}) - parablock.gsub!(/¡¡(\d+?)¡/u, + parablock.gsub!(/#{Mx[:tc_p]}#{Mx[:tc_p]}(\d+?)#{Mx[:tc_p]}/u, %{} + %{#{para_table}}) - parablock.gsub!(/!>/, '