Skip to content

Commit

Permalink
add table depth to the docx code
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Jun 27, 2024
1 parent f38568e commit 6149b45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Domains/Documents/Transformers/DocXTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,20 @@ public function handle(Document $document): array
return $chunks;
}


private function processTable(Table $table): string
{
$tableContent = [];
$rows = $table->getRows();
foreach ($rows as $row) {
$rowData = $this->processRow($row);
if (!empty($rowData)) {
$tableContent[] = '[Table Row: ' . implode(', ', $rowData) . ']';
if (! empty($rowData)) {
$tableContent[] = '[Table Row: '.implode(', ', $rowData).']';
}
}

return implode("\n", $tableContent);
}


private function processRow($row): array
{
$rowData = [];
Expand All @@ -137,6 +136,7 @@ private function processRow($row): array
}
}
}

return $rowData;
}
}

0 comments on commit 6149b45

Please sign in to comment.