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
bdf627ce07Marshall Bowers committed on 5/29/2024, 11:23:06 PM· committed by GitHubparenta501199
4 files changedLine totals unavailable