Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: table HTML generation corrected #355

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

pawel-kmiecik
Copy link
Contributor

@pawel-kmiecik pawel-kmiecik commented Jun 10, 2024

Currently unstructured-inference generates tables with missing markup:

<table>
  <thead> <!-- missing <tr> after <thead> -->
    <th>header cell1</th>
    <th>header cell2</th>
  </thead>
  <tr> <!-- would be nice to add <tbody> if <thead> is used -->
    <td>body cell1</td>
    <td>body cell2</td>
  <tr>
<table>

When it should look like:

<table>
  <thead>
    <tr>
      <th>header cell1</th>
      <th>header cell2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>body cell1</td>
      <td>body cell2</td>
    <tr>
  </tbody>
<table>

Additionally, fixed fill_cells function which added redundant cells that break the HTML table layout when spanned cells were found.

Copy link
Collaborator

@badGarnet badGarnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can just make this 0.7.35 for release

@pawel-kmiecik pawel-kmiecik enabled auto-merge (squash) June 13, 2024 09:59
@pawel-kmiecik pawel-kmiecik merged commit 0911892 into main Jun 13, 2024
5 checks passed
@pawel-kmiecik pawel-kmiecik deleted the pawel/fix-table-html-generation branch June 13, 2024 10:20
github-merge-queue bot pushed a commit to Unstructured-IO/unstructured that referenced this pull request Jun 14, 2024
Update to the evaluation script to handle correct HTML syntax for
tables.
See Unstructured-IO/unstructured-inference#355
for details.

This change:
- modifies transforming HTML tables to evaluation internal `cells`
format
- fixes the indexing of the output (internal format cells) when HTML
cells use spans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants