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

Issue #420 - Fix for empty table body crash #422

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

th0mr
Copy link
Contributor

@th0mr th0mr commented Nov 9, 2023

Hi,

I've put together a fix for the empty table body crash from issue #420. I've done this by mostly copying the code rinoh uses when it encounters a table with an empty header and I've applied it to tables with empty bodies.

This seems to fix the behavior so that it simply produces a table with only the header.
image

As for a regression test, I failed to get one made as I could not quite get a comparison pdf created in the same "minimal template" style produced by the nox run. Maybe I'm missing something obvious but what is the best way to generate the pdf files in this style for these tests?

Just so its written down somewhere, the test content looks like:

.. csv-table::
    :header: "This", "table", "has", "no", "body", "rows!"
    :file: ./empty_body_table.csv

Where empty_body_table.csv is just an empty file

@CLAassistant
Copy link

CLAassistant commented Nov 9, 2023

CLA assistant check
All committers have signed the CLA.

@brechtm brechtm merged commit 3c87c45 into brechtm:master Dec 14, 2023
brechtm added a commit that referenced this pull request Dec 14, 2023
@brechtm
Copy link
Owner

brechtm commented Dec 14, 2023

Thanks, @th0mr!

I added a test in 26635ef. Once a fix is implemented, you can just copy the generated known-good PDF output alongside the rst file. I hope this answers your question?

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.

3 participants