Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

rustdoc_to_markdown: Don't push blank space after newline (#12504)

Marshall Bowers1d46a52c62f3
diff --git a/crates/rustdoc_to_markdown/src/markdown_writer.rs b/crates/rustdoc_to_markdown/src/markdown_writer.rs
index 2d749110720..bafac18a33e 100644
--- a/crates/rustdoc_to_markdown/src/markdown_writer.rs
+++ b/crates/rustdoc_to_markdown/src/markdown_writer.rs
@@ -134,7 +134,7 @@ impl MarkdownWriter {
if tag.is_inline() && self.is_inside("p") {
if let Some(parent) = self.current_element_stack.iter().last() {
if !parent.is_inline() {
- if !self.markdown.ends_with(' ') {
+ if !(self.markdown.ends_with(' ') || self.markdown.ends_with('\n')) {
self.push_str(" ");
}
}