mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 18:52:07 +08:00
fixed according to pr
This commit is contained in:
parent
451d14c2e9
commit
1e6f1acef5
1 changed files with 3 additions and 7 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue