Skip to content

Generators: don't print empty code comparisons/rows #821

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

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 14, 2025

Description

When the documentation contained a <code_comparison>, but either both <code> title attributes were missing or both code blocks were empty, a table would be printed with an empty row.

Along the same lines, if a <code_comparison> exists, but both the <code> title attributes are missing AND both code blocks are empty, a complete empty table would be printed.

See the screenshots to see what I mean.

Neither is useful.

This commit cleans up the table output to only print the table and rows when there is information to display.

Includes updated test expectations.

Suggested changelog entry

Generators: cleaner output based on the elements available

Related issues/external references

This PR is part of a series of PRs which will add a complete set of tests (and improvements) for the Generator feature.

Also see: #671 and other PR with the Core Component: Generators label.


9-superfluous-table-rows-html-1
9-superfluous-table-rows-html-2
9-superfluous-table-rows-html-3
9-superfluous-table-rows-markdown-1
9-superfluous-table-rows-markdown-2
9-superfluous-table-rows-markdown-3
9-superfluous-table-rows-text-1
9-superfluous-table-rows-text-2
9-superfluous-table-rows-text-3

Verified

This commit was signed with the committer’s verified signature.
bhrutledge Brian Rutledge
When the documentation contained a `<code_comparison>`, but either both `<code>` `title` attributes were missing or both code blocks were empty, a table would be printed with an empty row.

Along the same lines, if a `<code_comparison>` exists, but both the `<code>` `title` attributes are missing AND both code blocks are empty, a complete empty table would be printed.

Neither is useful.

This commit cleans up the table output to only print the table and rows when there is information to display.

Includes updated test expectations.
@jrfnl jrfnl merged commit 7e9d490 into master Feb 15, 2025
59 checks passed
@jrfnl jrfnl deleted the feature/generators-no-empty-code-comparisons branch February 15, 2025 22:13
@jrfnl
Copy link
Member Author

jrfnl commented Feb 15, 2025

Thanks for reviewing @fredden !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants