Class: NotionToMd::Blocks::TableBlock

Inherits:
Block
  • Object
show all
Defined in:
lib/notion_to_md/blocks/table_block.rb

Instance Attribute Summary

Attributes inherited from Block

#block, #children

Instance Method Summary collapse

Methods inherited from Block

#initialize

Constructor Details

This class inherits a constructor from NotionToMd::Blocks::Block

Instance Method Details

#to_mdObject



6
7
8
9
10
11
12
13
14
# File 'lib/notion_to_md/blocks/table_block.rb', line 6

def to_md
  table = markdownify_children(0)

  table_header = table[0]
  table_aligment = markdownify_aligment
  table_body = table[1..table.size]

  [table_header, table_aligment, table_body].compact.join + newline
end