change hashtag formatting

This commit is contained in:
Anton-4 2024-01-28 18:15:24 +01:00
parent 01761abede
commit 30a5a2cfac
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
3 changed files with 3 additions and 15 deletions

View file

@ -154,7 +154,9 @@ fn fmt_comment(buf: &mut Buf, comment: &str) {
}
buf.push('#');
if !comment.starts_with(' ') {
// Add a space between the starting `#` and the rest of the comment,
// unless there already is one or the comment is of the form `#### something`.
if !comment.starts_with(' ') && !comment.starts_with('#') {
buf.spaces(1);
}
buf.push_str(comment.trim_end());