Skip to content

"Warnings" in docs show blank lines with numbers if line numbers in examples are turned on #3211

@paul-hansen

Description

@paul-hansen

Bug Report

Version

main and latest (e.g. tracing/0.1.41) on docs.rs

Crates

tracing
tracing-subscriber
tracing-core

Description

Turning on "Show line numbers on code examples" in the documentation shows line numbers above the warnings in some of the tracing crates. This seems to be because tracing crates use the example-wrap class for their warnings.

Show example image of how to turn on line numbers

Image

Example

From https://docs.rs/tracing/0.1.41/tracing/index.html

Image

Proposed solution

It looks like rustdoc has a documented way to format a warning block, maybe that should be used? I'd be happy to make a PR if desired.
https://doc.rust-lang.org/rustdoc/how-to-write-documentation.html#adding-a-warning-block

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions