# markdown: Fix escaping non-ASCII chars \(\#55782\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/c0596fade73036c6d2ab6f8a7caeac6722739e65)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: c0596fade73036c6d2ab6f8a7caeac6722739e65

Requested commit: c0596fade73036c6d2ab6f8a7caeac6722739e65

Commit: c0596fade73036c6d2ab6f8a7caeac6722739e65

Tree: a294399b4f7516c47651195eba43abec09d63228

Author: alkinun

Committer: GitHub

## Message

```
markdown: Fix escaping non-ASCII chars (#55782)

Fixes #55704

The `escape` function in `crates/markdown/src/markdown.rs` was calling
`c as u8` on the `char`s before passing to `MarkdownEscaper::next()`.
This strips non ASCII Unicode codepoints down to just their low 8 bits
which might be in the ASCII punctuation range and thus cause an extra
backslash to be added in front of these non ASCII chars.
 
Release Notes:

- Fixed a bug where non-ASCII chars in diagnostic messages were
incorrectly rendered with spurious `\` characters
```

## Parents

- [a949cabb327ddab4427ad753b172c6653845711f](https://git.cafe/gitcafe/zed/commit/a949cabb327ddab4427ad753b172c6653845711f?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/c0596fade73036c6d2ab6f8a7caeac6722739e65?format=markdown)
