Fix invalid removal of backlines from doc comments
This commit is contained in:
parent
60f3bd78ee
commit
ee97600a6f
2 changed files with 2 additions and 9 deletions
|
@ -34,18 +34,11 @@ pub fn beautify_doc_string(data: Symbol) -> Symbol {
|
|||
i += 1;
|
||||
}
|
||||
|
||||
while i < j && lines[i].trim().is_empty() {
|
||||
i += 1;
|
||||
}
|
||||
// like the first, a last line of all stars should be omitted
|
||||
if j > i && !lines[j - 1].is_empty() && lines[j - 1].chars().all(|c| c == '*') {
|
||||
j -= 1;
|
||||
}
|
||||
|
||||
while j > i && lines[j - 1].trim().is_empty() {
|
||||
j -= 1;
|
||||
}
|
||||
|
||||
if i != 0 || j != lines.len() { Some((i, j)) } else { None }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue