emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] ox-html does not export captions of source blocks without lang


From: Ihor Radchenko
Subject: Re: [BUG] ox-html does not export captions of source blocks without language
Date: Tue, 27 Dec 2022 14:08:32 +0000

Johan Bolmsjö <org-mode@johan.bitmaster.se> writes:

> ** Description
>
> The caption "Caption 1" is not exported by ox-html in the following
> source block.
>
> #+caption: Caption 1
> #+begin_src
> foo bar baz
> #+end_src
>
> The caption "Caption 2" is exported by ox-html in the following source
> block.
>
> #+caption: Caption 2
> #+begin_src sh
>   echo foo bar baz
> #+end_src
>
> ** Expectation
>
> The caption "Caption 1" is exported just as "Caption 2" is. The plain
> text exporter ox-ascii exports both "Caption 1" and "Caption 2".

Here is the plan to resolve this issue:

1. We update the manual allowing src blocks to have empty language spec
2. We update org-syntax document
3. We change org-html-src-block to add caption to src blocks without lang
4. We _do not_ treat such src blocks as example blocks.
   It is because at least ox-html, ox-latex, and ox-ascii never add
   captions to example blocks. Changing this default may possible, but
   require further discussion. The existing code already uses separate
   implementations for example blocks and src blocks with nil lang.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]