# Fix Markdown code rendering in tooltips ignoring languages \(\#10607\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7e1a1844468a559269e3772e2df1a162dbb23a53

Requested commit: 7e1a1844468a559269e3772e2df1a162dbb23a53

Commit: 7e1a1844468a559269e3772e2df1a162dbb23a53

Tree: cbbbc72564b88659000f9fcf830db1f0b63b43e4

Author: Thorsten Ball

Committer: GitHub

## Message

````
Fix Markdown code rendering in tooltips ignoring languages (#10607)

Some code blocks that are returned in tooltips (returned by language
servers, for example) use the language file extension as the language in
the the triple-backtick code blocks.

Example:

    ```rs
    fn rust_code() {}
    ```

    ```cpp
    fn rust_code() {}
    ```

Before this change we only looked up the language with the
`rs`/`cpp`/... being interpreted as the language name. Now we also treat
it as a possible file extension.



Release Notes:

- Fixed Markdown code blocks in tooltips not having correct language
highlighting.

Before:


![image](https://github.com/zed-industries/zed/assets/1185253/1f3870a6-467c-4e5f-9e49-1ff32240d10f)

After:

![screenshot-2024-04-16-12 43
39@2x](https://github.com/zed-industries/zed/assets/1185253/21a45ed5-825a-412d-9dc0-35a444fc64ba)

Co-authored-by: Bennet <bennetbo@gmx.de>
````

## Parents

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

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