emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Syntax discussion] Should we treat src blocks without LANG as parag


From: Tim Cross
Subject: Re: [Syntax discussion] Should we treat src blocks without LANG as paragraphs? (was: [BUG] ox-html does not export captions of source blocks without language)
Date: Fri, 16 Dec 2022 01:29:22 +1100
User-agent: mu4e 1.9.7; emacs 29.0.60

Max Nikulin <manikulin@gmail.com> writes:

> On 15/12/2022 16:31, Ihor Radchenko wrote:
>> The actual parser does allow empty lang in src blocks, setting :lang
>> element property to nil. Should we stop doing this and treat such src
>> blocks as paragraphs? Or should we allow empty lang and instead adapt
>> the exporters to treat empty lang correctly?
>
> Source blocks without language may be treated as #+begin_example blocks. I 
> believe, a
> warning should be issued in such case.
>
> I do not see a reason why caption is not allowed for examples.

Yes, I think I agree. Semantically, a src block without a language is
really just an example block - it cannot be executed or evaluated and is
essentially reduced to a example block.

I think having a warning is also a good idea as it will alert users when
they have inadvertently forgotten to add the lang.

I don't see any reason not to allow captions for examples either.



reply via email to

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