Skip to content

Commit

Permalink
fix newline issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Oct 27, 2023
1 parent 2288c60 commit 6ef3b36
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,13 +935,7 @@ fn source_excerpt<'a, T: ToTokens>(
let final_excerpt = &source[start_pos..min(end_pos + 1, source.len())];
Ok(final_excerpt
.lines()
.map(|line| {
if DOCIFY_ATTRIBUTES.is_match(line) && !line.trim().starts_with("//") {
"\n"
} else {
line
}
})
.filter(|line| !(DOCIFY_ATTRIBUTES.is_match(line) && !line.trim().starts_with("//")))
.collect::<Vec<&str>>()
.join("\n"))
}
Expand Down

0 comments on commit 6ef3b36

Please sign in to comment.