Skip to content

Commit bfd74f0

Browse files
Strip last backline from non-rust code examples
1 parent da88968 commit bfd74f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/librustdoc/html/markdown.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
261261
</pre>\
262262
</div>",
263263
added_classes = added_classes.join(" "),
264-
text = Escape(&original_text),
264+
text = Escape(
265+
original_text.strip_suffix('\n').unwrap_or(&original_text)
266+
),
265267
)
266268
.into(),
267269
));

0 commit comments

Comments
 (0)