# Fenced code block attributes

**URL:** <https://forum.obsidian.md/t/fenced-code-block-attributes/29158>\
**Category:** Feature requests\
**Created:** [December 23, 2021, 10:30pm UTC](https://forum.obsidian.md/t/fenced-code-block-attributes/29158 "2021-12-23T22:30:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janlo](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/j/f08c70/32.png) [@Janlo](https://forum.obsidian.md/u/Janlo)\
**Post date:** [December 23, 2021, 10:30pm UTC](https://forum.obsidian.md/t/fenced-code-block-attributes/29158/1 "2021-12-23T22:30:13Z")

</div>

### Use case or problem

I’d like to write documentation which I later publish as pdf via pandoc in obsidian. Therefore I’d like to have more pandoc features in obsidian.

My current issue is that I want captions for code blocks in my pdf. Pandoc allows fenced code block attributes to define a caption: [Pandoc - Pandoc User’s Guide](https://pandoc.org/MANUAL.html#extension-fenced_code_attributes)

I was wondering if obsidian would allow the same syntax. I do not expect any evaluation of the actual attributes in obsidian but I’d like to use the syntax to give e.g. my python highlited code block a caption in the resulting pdf while still have python highliting in obsidian.

### Proposed solution

As mentioned above, support the attribute syntaxe apart from the simple language specification after the three backticks.

### Current workaround (optional)

I keep two versions of the same MD file.

---

<div class="post-metadata">

**Author:** ![Wumm](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/w/51bf81/32.png) [@Wumm](https://forum.obsidian.md/u/Wumm)\
**Post date:** [November 11, 2024, 10:14pm UTC](https://forum.obsidian.md/t/fenced-code-block-attributes/29158/2 "2024-11-11T22:14:06Z")

</div>

Would love that as well. Have also been looking for a way to add captions to my code blocks (or images for that matter). Current workaround is adding an emphasized line below my fenced code block: _caption_. This looks good in editing mode but gets rendered with a blank line between code block and caption in reading mode (which is confusing when you have several code blocks with such a caption after one another since the space from caption to above code block is identical to the space from caption to (other) code block below).
