From e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Oct 2007 19:27:16 +0100 Subject: mostly the arrangement of conditionals --- lib/sisu/v0/html_tune.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v0/html_tune.rb') diff --git a/lib/sisu/v0/html_tune.rb b/lib/sisu/v0/html_tune.rb index ab37abb2..caf88d79 100644 --- a/lib/sisu/v0/html_tune.rb +++ b/lib/sisu/v0/html_tune.rb @@ -261,7 +261,8 @@ module SiSU_Tune image_path=if @md.fns =~/\.-ss[tm]$/; @env.url.images_external else @env.url.images_local end - ins=if u and u.strip !~/^image$/ + ins=if u \ + and u.strip !~/^image$/ %{#{caption}} else %{#{caption}} end @@ -322,13 +323,15 @@ module SiSU_Tune para.gsub!(/!new/, %{ new}) para.gsub!(/<:h(.{1,7}?)>/,'\1') para.gsub!(/<:to(\d{1,7}?)>/,'to { \1 } ') - if (para =~/\b\S+\@\S+?\.\S+/ and para !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/) + if para =~/\b\S+\@\S+?\.\S+/ \ + and para !~/(\"\S+\@\S+?\.\S+\"|>\S+\@\S+?\.\S+?<)/ para.gsub!(/\b(\S+\@\S+?\.\S+)(\s)/,'<\1>\2') end 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 - if (para =~/..\/\S+/ and para !~/(\"..\/\S+?\"|>\s*..\/\S+<)/) + if para =~/..\/\S+/ \ + and para !~/(\"..\/\S+?\"|>\s*..\/\S+<)/ para.gsub!(/(\.\.\/\S+)/,'\1') end para.gsub!(/