mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-24 17:28:40 +00:00
fix(blame): fix incorrect rendering of angle brakets in git blame tooltip
This originally broke in f633b125b9
, this
commit simply replaced `<` and `>` characters with their HTML encoded
equivalents. While this worked, it was not correct for the case where
`<` or `>` exist inside code blocks.
This also felt confusing that this was not happening where the markdown
was being parsed, but rather where where the blame message was retrieved
from git.
This commit fixes #22044, and **should not** cause a regression in
\#16220, by pushing any `InlineHtml` to the resulting string after
parsing the markdown.
This commit is contained in:
parent
f64fcedabb
commit
e66a653ea9
2 changed files with 5 additions and 1 deletions
|
@ -32,7 +32,7 @@ pub fn get_messages(working_directory: &Path, shas: &[Oid]) -> Result<HashMap<Oi
|
|||
String::from_utf8_lossy(&output.stdout)
|
||||
.trim()
|
||||
.split_terminator(MARKER)
|
||||
.map(|str| str.trim().replace("<", "<").replace(">", ">")),
|
||||
.map(|str| String::from(str.trim())),
|
||||
)
|
||||
.collect::<HashMap<Oid, String>>())
|
||||
}
|
||||
|
|
|
@ -306,6 +306,10 @@ pub async fn parse_markdown_block(
|
|||
|
||||
Event::SoftBreak => text.push(' '),
|
||||
|
||||
Event::InlineHtml(inline_html) => {
|
||||
text.push_str(&inline_html);
|
||||
}
|
||||
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue