# git_ui: Escape markdown in discard confirmation dialog \(\#56197\) · gitcafe/zed

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

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

Visibility: public

Requested revision: e621d0dd05b2afa60385b583ddb5d5f149170dbd

Requested commit: e621d0dd05b2afa60385b583ddb5d5f149170dbd

Commit: e621d0dd05b2afa60385b583ddb5d5f149170dbd

Tree: a2ee3c2a1c7d529081efa71527d84cbca0017b5a

Author: alkinun

Committer: GitHub

## Message

````
git_ui: Escape markdown in discard confirmation dialog (#56197)

## Summary

Filenames containing markdown syntax (e.g. `__somefile__`, `*somefile*`)
were being rendered as formatted text in the git discard confirmation
dialog.

Follow-up to #55697 for the git discard confirmation path mentioned in
#53060.

## Changes

Wrapped the git discard confirmation filename with `MarkdownInlineCode`
in `git_panel.rs`, so special markdown characters like `_`, `*`, and `[`
render literally.

## Testing

Added `test_discard_prompt_escapes_markdown_in_file_name` in
`git_panel.rs` to verify filenames with markdown special characters
render literally in the discard confirmation dialog.

Run:
```bash
cargo test -p git_ui test_discard_prompt_escapes_markdown_in_file_name
```

Release Notes:

- Fixed file names containing markdown special characters (e.g.
`__somefile__`) being rendered as formatted text in the git discard
confirmation dialog.
````

## Parents

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

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