On Wed, Dec 14, 2022, at 22:51, Kaushal Modi wrote: > On Wed, Dec 14, 2022, 4:44 PM Johan Bolmsjö <org-m...@johan.bitmaster.se> > wrote: >> 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 begin_src block always requires a "language" as far as I know. If you > don't want to specify a language, you can use #+begin_example instead. > > You can even do "#+begin_src text". > > It's a different issue as to why you are seeing a different behavior between > the two exporters.
Okay, the manual confirms that the language is mandatory. https://orgmode.org/manual/Structure-of-Code-Blocks.html "#+begin_src text" exports the caption with both ox-html and ox-ascii. "#+begin_example" export the caption with neither ox-html nor ox-ascii. So the only discrepancy is how the two exporters handles this non-conforming source block.