Skip to content

The doc contents are incorrectly made bold under certain situation #101743

Closed
@cmpute

Description

@cmpute

Problem

This bug happens when an associated constant is generated from a generic const function. The brackets surrounding the generic parameters are interpreted as an HTML tag.

Steps

If the documentation is like this in the code:

impl<const A: Word> Repr<A> {
    /// The base of the representation. It's exposed as an [IBig] constant.
    pub const BASE: IBig = base_as_ibig::<A>();
}

The documentation looks like:
Snipaste_2022-09-12_20-17-34
(the text becomes a link)


If the documentation is

impl<const B: Word> Repr<B> {
    /// The base of the representation. It's exposed as an [IBig] constant.
    pub const BASE: IBig = base_as_ibig::<B>();

    /// Create a [Repr] instance representing value zero
    pub const fn zero() -> Self { todo!() }
}

The documentation looks like
Snipaste_2022-09-12_20-15-21

(it even affects the documentation of other items in the same page

Possible Solution(s)

The generic brackets should be escaped

Notes

No response

Version

cargo 1.63.0 (fd9c4297c 2022-07-01)
release: 1.63.0
commit-hash: fd9c4297ccbee36d39e9a79067edab0b614edb5a
commit-date: 2022-07-01
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1n)
os: Ubuntu 20.04 (focal) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions