File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
packages/notion-compat/src Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -317,11 +317,36 @@ export function convertBlock({
317
317
break
318
318
319
319
case 'table' :
320
- // TODO
320
+ if ( blockDetails . table_width && blockDetails . table_width > 0 ) {
321
+ // There is no API to get the column ID. Used the index instead.
322
+ compatBlock . format . table_block_column_order = Array . from (
323
+ { length : blockDetails . table_width } ,
324
+ ( _ , i ) => '' + i
325
+ )
326
+ compatBlock . format . table_block_column_format =
327
+ compatBlock . format . table_block_column_order . map ( ( order ) => {
328
+ return {
329
+ [ order ] : {
330
+ // TODO: The SimpleTable column has no width and color. API is not supported.
331
+ // width: 155,
332
+ // color:
333
+ }
334
+ }
335
+ } )
336
+ }
337
+ if ( blockDetails . has_column_header ) {
338
+ compatBlock . format . table_block_column_header =
339
+ blockDetails . has_column_header
340
+ }
341
+ if ( blockDetails . has_row_header ) {
342
+ compatBlock . format . table_block_row_header = blockDetails . has_row_header
343
+ }
321
344
break
322
345
323
346
case 'table_row' :
324
- // TODO
347
+ compatBlock . properties = {
348
+ ...block . table_row ?. cells ?. map ( ( cell ) => convertRichText ( cell ) )
349
+ }
325
350
break
326
351
327
352
case 'pdf' :
You can’t perform that action at this time.
0 commit comments