# rustdoc_to_markdown: Fix code blocks \(\#12460\) · gitcafe/zed

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

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

Visibility: public

Requested revision: bdf627ce07e7f0d4dc72eafca3be276c4ed8ca5d

Requested commit: bdf627ce07e7f0d4dc72eafca3be276c4ed8ca5d

Commit: bdf627ce07e7f0d4dc72eafca3be276c4ed8ca5d

Tree: e95a01da221ce303321aed20df3c19f62795409d

Author: Marshall Bowers

Committer: GitHub

## Message

```
rustdoc_to_markdown: Fix code blocks (#12460)

This PR fixes an issue in `rustdoc_to_markdown` with code blocks being
trimmed incorrectly.

We were erroneously popping from the current element stack even if we
didn't push an element onto the stack.

Added test coverage for this case as well, so we don't regress.

Release Notes:

- N/A
```

## Parents

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

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