7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/coradoc/mirror/handlers/table.rb', line 7
def self.call(element, context:)
rows = Array(element.rows)
return nil if rows.empty?
head_rows, body_rows = partition_rows(rows)
content = []
content << build_table_head(head_rows, context) unless head_rows.empty?
content << build_table_body(body_rows, context) unless body_rows.empty?
return nil if content.empty?
Node::Table.new(
attrs: Node::Table::Attrs.new(
id: element.id,
title: element.title,
width: element.width
),
content: content
)
end
|