mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Fix parsing '#'-hiding of rustdoc
This commit is contained in:
parent
b2a80f9942
commit
2eca09e438
@ -500,7 +500,7 @@ fn rewrite_comment_inner(
|
||||
const RUSTFMT_CUSTOM_COMMENT_PREFIX: &str = "//#### ";
|
||||
|
||||
fn hide_sharp_behind_comment<'a>(s: &'a str) -> Cow<'a, str> {
|
||||
if s.trim_left().starts_with('#') {
|
||||
if s.trim_left().starts_with("# ") {
|
||||
Cow::from(format!("{}{}", RUSTFMT_CUSTOM_COMMENT_PREFIX, s))
|
||||
} else {
|
||||
Cow::from(s)
|
||||
|
Loading…
Reference in New Issue
Block a user