table_parser 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/table_parser.rb CHANGED
@@ -4,5 +4,5 @@ require 'table_parser/table'
4
4
  require 'table_parser/parser'
5
5
 
6
6
  module TableParser
7
- VERSION = '0.5.4'
7
+ VERSION = '0.5.5'
8
8
  end
@@ -46,8 +46,6 @@ module TableParser
46
46
  node = TableNode.new(ele)
47
47
  end
48
48
  end
49
-
50
- puts " data/length = #{data.size}"
51
49
 
52
50
  # handle rowspan
53
51
  data.each_index do |row_index|
@@ -65,11 +63,11 @@ module TableParser
65
63
  end
66
64
  end
67
65
 
68
- if col.rowspan > 1 && data[row_index].size > 0
66
+ if col.rowspan > 1 && data[row_index+1]
69
67
  if dup_rows
70
- data[row_index].insert(col_index, TableNode.new(col.element, col.rowspan - 1))
68
+ data[row_index+1].insert(col_index, TableNode.new(col.element, col.rowspan - 1))
71
69
  else
72
- data[row_index].insert(col_index, EmptyTableNode.new(col.rowspan - 1))
70
+ data[row_index+1].insert(col_index, EmptyTableNode.new(col.rowspan - 1))
73
71
  end
74
72
  end
75
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Chong