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

Trait method comments gets unescaped by pulldown rustdoc #48332

Closed
Ogeon opened this issue Feb 18, 2018 · 1 comment · Fixed by #73819
Closed

Trait method comments gets unescaped by pulldown rustdoc #48332

Ogeon opened this issue Feb 18, 2018 · 1 comment · Fixed by #73819
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

@Ogeon
Copy link

Ogeon commented Feb 18, 2018

It seems like documentation comments on trait methods get unescaped when they are shown as implemented traits. Something like a\*b\*c\* shows up as a*b*c* in the trait documentation, but as abc* when looking at a type that implements the trait. Adding double escapes makes it look bad on the trait page instead, and replacing * with * doesn't help, since it gets reinterpreted as * anyway.

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-dev-tools-rustdoc labels Feb 19, 2018
@TimNN TimNN added the C-bug Category: This is a bug. label Feb 20, 2018
@Mark-Simulacrum
Copy link
Member

This is not fixed, can be reproduced with this source, where the trait method on the struct's page will render incorrectly:

image

pub trait Foo {
    /// Words a\*b\*c\* words
    fn foo() {
    }
}

pub struct A;

impl Foo for A {
}

fn main() {}

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 3, 2020
…illaumeGomez

rustdoc: do not use plain summary for trait impls

Fixes rust-lang#38386.
Fixes rust-lang#48332.
Fixes rust-lang#49430.
Fixes rust-lang#62741.
Fixes rust-lang#73474.

Unfortunately this is not quite ready to go because the newly-working links trigger a bunch of linkcheck failures. The failures are tough to fix because the links are resolved relative to the implementor, which could be anywhere in the module hierarchy.

(In the current docs, these links end up rendering as uninterpreted markdown syntax, so I don't think these failures are any worse than the status quo. It might be acceptable to just add them to the linkchecker whitelist.)

Ideally this could be fixed with intra-doc links ~~but it isn't working for me: I am currently investigating if it's possible to solve it this way.~~ Opened rust-lang#73829.

EDIT: This is now ready!
@bors bors closed this as completed in e0822ec Sep 3, 2020
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.

5 participants