fixed according to pr

This commit is contained in:
Zanz2 2018-03-05 17:02:37 +01:00
parent 451d14c2e9
commit 1e6f1acef5

View file

@ -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] + '<tr></tr>' * diff
end
table_fix_str = table[0]
table_fix_str += '<tr></tr>' * 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(