diff options
author | Ralph Amissah <ralph@amissah.com> | 2007-10-15 19:27:16 +0100 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2007-10-15 19:27:16 +0100 |
commit | e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 (patch) | |
tree | 6ffe3ae1b2453578a032ce053934a31f980645e9 /lib/sisu/v0/dal_doc_str_tables.rb | |
parent | regex matching of images, (and rearrangement of conditionals) (diff) |
mostly the arrangement of conditionals
Diffstat (limited to 'lib/sisu/v0/dal_doc_str_tables.rb')
-rw-r--r-- | lib/sisu/v0/dal_doc_str_tables.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sisu/v0/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb index e0d019bb..52b53e4f 100644 --- a/lib/sisu/v0/dal_doc_str_tables.rb +++ b/lib/sisu/v0/dal_doc_str_tables.rb @@ -131,7 +131,8 @@ module SiSU_document_structure_tables if para =~/^\{(?:t|table)(?:~h)?(?:\sc\d+;)?[\d; ]*\}/ @tuned_file << table_visual(para) @tuned_file=@tuned_file.flatten - elsif @@flag['table_to'] or para[/^table\{(?:~h)?/] + elsif @@flag['table_to'] \ + or para[/^table\{(?:~h)?/] if para[/table\{(?:~h)?\s+c(\d+;.+)/] instructions=$1 @@column=instructions.split(/;\s*/) @@ -140,7 +141,8 @@ module SiSU_document_structure_tables para.gsub!(/^table\{\s+(c\d+?;.+?)$/,'<!T¡ \1!>') @@flag['table_to']=true end - if @@flag['table_to'] and para =~/\}table/ + if @@flag['table_to'] \ + and para =~/\}table/ para.gsub!(/^\}table\s*$/,"<!TZ!>\n") para.gsub!(/\n/,' ') #newlines taken out para.strip! @@ -151,7 +153,8 @@ module SiSU_document_structure_tables @tuned_table=[] @@flag['table_to']=false end - if @@flag['table_to'] and para =~/\S/ + if @@flag['table_to'] \ + and para =~/\S/ @@counter=1 sub_array=para.dup @@line_mode=sub_array.scan(/.+/) @@ -174,7 +177,8 @@ module SiSU_document_structure_tables def tr_td data=@data data.each do |line| - if @@counter <= @@columns.to_i and line !~/(\}T\s*$|<:table[-_](close|end)>|<!TZ!>)/ + if @@counter <= @@columns.to_i \ + and line !~/(\}T\s*$|<:table[-_](close|end)>|<!TZ!>)/ line.gsub!(/(.+)/,"¡¡#{@@column[@@counter]}¡\\1") unless line =~/<!Th?¡/ @@counter+=1 end |