diff --git a/src/lib.rs b/src/lib.rs index 4e7572a..e4b1dbc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -403,12 +403,12 @@ where } CodeBlock(CodeBlockKind::Fenced(info)) => { state.is_in_code_block = true; - let s = if !consumed_newlines { + let s = if consumed_newlines { + Ok(()) + } else { formatter .write_char('\n') .and_then(|()| padding(formatter, &state.padding)) - } else { - Ok(()) }; s.and_then(|()| {