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 +1 -1
- data/lib/table_parser/parser.rb +3 -5
- metadata +1 -1
data/lib/table_parser.rb
CHANGED
data/lib/table_parser/parser.rb
CHANGED
@@ -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]
|
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
|