You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
max-heller
changed the title
Line hiding in Rust code blocks is inconsistent with `rustdoc1
Line hiding in Rust code blocks is inconsistent with rustdocJan 18, 2025
Problem
Lines in Rust code blocks beginning with a
are hidden by
#
and followed immediately by a character other than!
,[
,#
, ormdbook
but shown byrustdoc
.For example, the following code block is rendered as empty by
mdbook
:Meanwhile, the following code block in a doc comment:
is rendered as
Steps
mdbook init
echo '```rust\n#fn main() {}\n```' > src/chapter_1.md
mdbook serve
fn main() {}
Possible Solution(s)
mdbook
should implementrustdoc
's behavior since the docs claim it does:Notes
rustdoc
's rules are:#
(note the space following the#
), the line is hidden##
can be used to prevent the hiding of a line that would otherwise be hidden#
, write##
which will render as#
Is
mdbook
willing to change this in a non-breaking release since it seems like a bug according to the docs, or would you rather wait until 0.5?Version
The text was updated successfully, but these errors were encountered: