Fix interpretation of \n in hovers (#10214)

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.
This commit is contained in:
Mikayla Maki 2024-04-05 15:59:37 -07:00 committed by GitHub
parent 7b636d9774
commit fe4b345603
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,