Fenced code block attributes

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

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.

1 Like

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).