Skip to content

Commit

Permalink
Fix interpretation of \n in hovers (zed-industries#10214)
Browse files Browse the repository at this point in the history
I ran into this specifically when looking at the documentation of
https://crates.io/crates/wayland-client

Release Notes:

- Fixed a bug where some hover popovers would render `\n` instead of a
new line.
  • Loading branch information
mikayla-maki authored Apr 5, 2024
1 parent 7b636d9 commit fe4b345
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/editor/src/hover_popover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ async fn parse_blocks(
match &block.kind {
HoverBlockKind::PlainText => {
markdown::new_paragraph(&mut text, &mut Vec::new());
text.push_str(&block.text);
text.push_str(&block.text.replace("\\n", "\n"));
}

HoverBlockKind::Markdown => {
markdown::parse_markdown_block(
&block.text,
&block.text.replace("\\n", "\n"),
language_registry,
language.clone(),
&mut text,
Expand Down

0 comments on commit fe4b345

Please sign in to comment.