diff --git a/app/helpers/protocols_io_helper.rb b/app/helpers/protocols_io_helper.rb index 769d09210..e1b161ba4 100644 --- a/app/helpers/protocols_io_helper.rb +++ b/app/helpers/protocols_io_helper.rb @@ -57,12 +57,8 @@ module ProtocolsIoHelper tables[table_counter.to_s] = {} tr_number = table[0].scan(tr_regex).count diff = PIO_TABLE_MIN_HEIGHT - tr_number # always tables have atleast 5 row - table_fix_str = - if tr_number >= PIO_TABLE_MIN_HEIGHT - table[0] - else - table[0] + '' * diff - end + table_fix_str = table[0] + table_fix_str += '' * diff if tr_number < PIO_TABLE_MIN_HEIGHT tr_strings = table_fix_str.scan(tr_regex) contents = {} contents['data'] = [] @@ -75,7 +71,7 @@ module ProtocolsIoHelper td_stripped = ActionController::Base.helpers.strip_tags(td[0]) contents['data'][tr_counter].push(td_stripped) end - next if td_counter >= 5 + next if td_counter >= PIO_TABLE_MIN_WIDTH diff.times { contents['data'][tr_counter].push(' ') } end tables[table_counter.to_s]['contents'] = Base64.encode64(