cargo-readme icon indicating copy to clipboard operation
cargo-readme copied to clipboard

Code fences have "rust" added to closing fence

Open detly opened this issue 3 years ago • 1 comments

The following doc comment:

//!
//! This crate frequently uses a trait bound like the following where subprocess
//! commands are required:
//!
//! ```none,actually-rust-but-see-https://github.com/rust-lang/rust/issues/63193
//! T where
//!     T: IntoIterator,
//!     T::Item: Into<OsString>
//! ```
//!
//! You can understand this as:
//! - `T` is anything that can turn into an iterator
//! - the iterator type is anything that can turn into an `OsString`
//!

Gets turned into:

This crate frequently uses a trait bound like the following where subprocess
commands are required:

```none,actually-rust-but-see-https://github.com/rust-lang/rust/issues/63193
T where
    T: IntoIterator,
    T::Item: Into<OsString>
```rust

You can understand this as:
- `T` is anything that can turn into an iterator
- the iterator type is anything that can turn into an `OsString`

The trailing ```rust should not be there. cargo doc seems to do the right thing, by comparison.

Using cargo-readme v3.2.0 on Rust 1.59.0 + Ubuntu 21.10.

detly avatar Mar 14 '22 01:03 detly

this also happens with using no-run in example code in documentation, such as in lib.rs I think adding support for no-run is helpful. It does not add it when I use sh

1sra3l avatar Mar 22 '22 16:03 1sra3l