markdown-mode icon indicating copy to clipboard operation
markdown-mode copied to clipboard

Code block insertion should exist in two flavours with and without braces

Open christophe-gouel opened this issue 5 months ago • 0 comments

Currently, there is one function to insert code blocks: markdown-insert-gfm-code-block. If the customizable variable markdown-insert-gfm-code-block is t, it inserts the block with braces, while if it is nil, it is without braces. This seems too restrictive. Both code blocks can co-exist in a document for different purposes. According to pandoc documentation, braces can be used to add properties to a code block (such as line numbers). On the other hand, in Quarto, code blocks with braces correspond to executable blocks while code blocks without braces are just to be displayed.

If you are interested in this simple extension, I can prepare a PR adding another function. The key issue is which keybinding to associate to this function given how crowded is the markdown-mode-style-map.

christophe-gouel avatar Jun 01 '25 17:06 christophe-gouel