aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/dal_doc_str_tables.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/dal_doc_str_tables.rb')
-rw-r--r--lib/sisu/v0/dal_doc_str_tables.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/sisu/v0/dal_doc_str_tables.rb b/lib/sisu/v0/dal_doc_str_tables.rb
index a17eb63f..5b636dfa 100644
--- a/lib/sisu/v0/dal_doc_str_tables.rb
+++ b/lib/sisu/v0/dal_doc_str_tables.rb
@@ -97,29 +97,29 @@ module SiSU_document_structure_tables
w=widths.split(/;/)
tuned_file=[]
tuned_file << if para =~/\{(?:t|table)~h(?:\sc\d+;)?[\d; ]*\}/
- "<!Th#{TS1} c#{@row[2].length}; #{widths}!>"
+ "#{Mx[:gr_o]}Th#{Mx[:tc_p]} c#{@row[2].length}; #{widths}#{Mx[:gr_c]}"
elsif para =~/\{(?:t|table)(?:\sc\d+;)?[\d; ]*\}/
- "<!T#{TS1} c#{@row[2].length}; #{widths}!>"
+ "#{Mx[:gr_o]}T#{Mx[:tc_p]} c#{@row[2].length}; #{widths}#{Mx[:gr_c]}"
end
@row.each do |l|
l << '' if l.length == (@row[1].length - 1)
table=[]
if l.length == @row[1].length
- table << '<!' #'<tr>'
+ table << Mx[:tc_o] #'<tr>'
n= -1
l.each do |c|
n +=1 #'<td>' + c + '</td>'
table << if c =~/\A(?:\n)?\s*\Z/
- "#{TS1}#{TS1}#{w[n]}#{TS1}" + ' '
+ "#{Mx[:tc_p]}#{Mx[:tc_p]}#{w[n]}#{Mx[:tc_p]}" + ' '
else
- "#{TS1}#{TS1}#{w[n]}#{TS1}" + c.strip
+ "#{Mx[:tc_p]}#{Mx[:tc_p]}#{w[n]}#{Mx[:tc_p]}" + c.strip
end
end
- table << '!>' #'</tr>'
+ table << Mx[:tc_c]
tuned_file << table.join
end
end
- tuned_file << '<!TZ!>' #'</table>'
+ tuned_file << "#{Mx[:gr_o]}TZ#{Mx[:gr_c]}" #'</table>'
tuned_file=tuned_file.compact.join("\n")
end
def tables
@@ -141,13 +141,13 @@ module SiSU_document_structure_tables
instructions=$1
@@column=instructions.split(/;\s*/)
@@columns=@@column[0]
- para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,"<!Th#{TS1} \\1!>")
- para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"<!T#{TS1} \\1!>")
+ para.gsub!(/^table\{~h\s+(c\d+?;.+?)$/,"#{Mx[:gr_o]}Th#{Mx[:tc_p]} \\1#{Mx[:gr_c]}")
+ para.gsub!(/^table\{\s+(c\d+?;.+?)$/,"#{Mx[:gr_o]}T#{Mx[:tc_p]} \\1#{Mx[:gr_c]}")
@@flag['table_to']=true
end
if @@flag['table_to'] \
and para =~/\}table/
- para.gsub!(/^\}table\s*$/,"<!TZ!>\n")
+ para.gsub!(/^\}table\s*$/,"#{Mx[:gr_o]}TZ#{Mx[:gr_c]}\n")
para.gsub!(/\n/,' ') #newlines taken out
para.strip!
@tuned_table << para
@@ -164,13 +164,13 @@ module SiSU_document_structure_tables
@@line_mode=sub_array.scan(/.+/u)
Tables.new(@md,@@line_mode).tr_td
para=@@line_mode.join
- para.gsub!(/(.*\S+.*)\Z/m,'<!\1!>') unless para =~/<!Th?#{TS1}/u
+ para.gsub!(/(.*\S+.*)\Z/m,"#{Mx[:tc_o]}\\1#{Mx[:tc_c]}") unless para =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}/u
end
para.gsub!(/\n/,' ')
para.strip!
@tuned_table << para
else
- para.gsub!(/\n/,' ') unless para =~/<:(?:code|verse|alt|group)>/
+ para.gsub!(/\n/,' ') unless para =~/#{Mx[:gr_o]}(?:code|verse|alt|group)#{Mx[:gr_c]}/
para.strip!
@tuned_file << para
end
@@ -182,11 +182,11 @@ module SiSU_document_structure_tables
data=@data
data.each do |line|
if @@counter <= @@columns.to_i \
- and line !~/(\}T\s*$|<:table[-_](close|end)>|<!TZ!>)/
+ and line !~/(\}T\s*$|#{Mx[:gr_o]}:table[-_](close|end)#{Mx[:gr_c]}|#{Mx[:gr_o]}TZ#{Mx[:gr_c]})/
#if line.encoding.inspect =~/Encoding:ASCII-8BIT/
# line=line.force_encoding('utf-8')
#end
- line.gsub!(/(.+)/,"#{TS1}#{TS1}#{@@column[@@counter]}#{TS1}\\1") unless line =~/<!Th?#{TS1}/u
+ line.gsub!(/(.+)/,"#{Mx[:tc_p]}#{Mx[:tc_p]}#{@@column[@@counter]}#{Mx[:tc_p]}\\1") unless line =~/#{Mx[:gr_o]}Th?#{Mx[:tc_p]}/u
@@counter+=1
end
end