inside_code_block = !inside_code_block;
}
if inside_code_block {
- result.push_str(line);
+ if line.is_empty() && result.ends_with(' ') {
+ result.pop();
+ } else {
+ result.push_str(line);
+ }
continue;
}
context: &RewriteContext,
) -> Option<String> {
let snippet = context.snippet(span);
- if snippet != new && changed_comment_content(&snippet, &new) {
+ if snippet != new && changed_comment_content(snippet, &new) {
// We missed some comments. Keep the original text.
Some(snippet.to_owned())
} else {