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

rustdoc: inconsistent number of blank lines rendered top/bottom #102996

Open
ojeda opened this issue Oct 13, 2022 · 0 comments · May be fixed by #103376
Open

rustdoc: inconsistent number of blank lines rendered top/bottom #102996

ojeda opened this issue Oct 13, 2022 · 0 comments · May be fixed by #103376
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@ojeda
Copy link
Contributor

ojeda commented Oct 13, 2022

I tried this code:

/// ```
/// # use c::f;
///
///
/// f()?;
///
///
/// # Ok::<(), i32>(())
/// ```

I expected to see this happen: the same number of blank lines rendered on the top and bottom (0, 1 or 2 depending on what rule is followed).

Instead, this happened: currently it renders 2 on top, but 1 at the bottom, which is confusing.

I assume the idea is that the user does not add any blank line at all. However, since leaving 1 line in the bottom renders fine (even if the generated HTML does contain an extra newline), users may assume that it also works for the top, especially in projects that e.g. group hidden/not hidden uses at the top. For instance, the following appears to work fine:

/// ```
/// # use c::very_common_thing;
/// use c::f;
///
/// f(very_common_thing)?;
///
/// # Ok::<(), i32>(())
/// ```

Meta

Seems to have happened since a while ago, see #78695 for a related feature request that would fix this bug by leaving 0 lines on both top and bottom (which would be consistent).

@ojeda ojeda added the C-bug Category: This is a bug. label Oct 13, 2022
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants