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

Skip rendering empty descriptions #355

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

jonathanhefner
Copy link
Member

RDoc::CodeObject#comment appears to always return a string, even if no comment has been specified. Thus the truthiness of comment cannot be used to skip rendering empty descriptions.

This commit adds a description_for helper to encapsulate properly checking comment and wrapping the rendered description in a div.

This commit also renames the full_name and short_name helpers to full_name_for and short_name_for to match description_for.

`RDoc::CodeObject#comment` appears to always return a string, even if no
comment has been specified.  Thus the truthiness of `comment` cannot be
used to skip rendering empty descriptions.

This commit adds a `description_for` helper to encapsulate properly
checking `comment` and wrapping the rendered description in a `div`.

This commit also renames the `full_name` and `short_name` helpers to
`full_name_for` and `short_name_for` to match `description_for`.
@jonathanhefner jonathanhefner merged commit 7e67807 into rails:main Jan 4, 2024
9 checks passed
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.

1 participant