Skip to content

rustdoc adds extra spaces where it shouldn't #42013

Closed

Description

@steveklabnik

As seen here: https://doc.rust-lang.org/std/sync/struct.Weak.html

These docs:

/// pointer, which returns an [`Option`]`<`[`Arc`]`<T>>`.

render like this:

optionarc

Those extra spaces shouldn't be there.

Activity

  1. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on May 15, 2017
  2. Mark-Simulacrum commented on May 15, 2017

    @Mark-Simulacrum
    Member

    https://doc.rust-lang.org/nightly/std/sync/struct.Weak.html is a better link, I think -- stable doesn't have this documentation quite yet.

  3. steveklabnik commented on May 15, 2017

    @steveklabnik
    ContributorAuthor

    gah, yes, thank you

  4. tommyip commented on May 15, 2017

    @tommyip
    Contributor

    Seems like a problem with CSS padding of <code> blocks.
    The current rendered HTML looks like:

    <a href="../../std/option/enum.Option.html"><code>Option</code></a>
    <code>&lt;</code>
    <a href="struct.Arc.html"><code>Arc</code></a>
    <code>&lt;T&gt;&gt;</code>

    I guess we want it to be like:

    <code>
        <a href="../../std/option/enum.Option.html">Option</a>
        &lt;
        <a href="struct.Arc.html">Arc</a>
        &lt;T&gt;&gt;
    </code>
  5. GuillaumeGomez commented on May 15, 2017

    @GuillaumeGomez
    Member

    That's wanted. I added it this way to make easier to spot if different types are present.

  6. added
    T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.
    on May 18, 2017
  7. kzys commented on Sep 1, 2018

    @kzys
    Contributor

    Personally I don't like the spacing. IDEs and even other sections in Rustdoc (e.g. pub fn upgrade(&self) -> Option<Arc<T>>) doesn't have spacing around types like that.

    Or maybe we can change padding from 0.2em to 0.1em?

  8. joshtriplett commented on Sep 18, 2018

    @joshtriplett
    Member

    👍 for fixing this spacing.

  9. GuillaumeGomez commented on Sep 18, 2018

    @GuillaumeGomez
    Member

    Ok, I'll reduce it (but won't remove it).

  10. added a commit that references this issue on Sep 25, 2018
    d2f9e66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugCategory: This is a bug.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions