Hello Ihor, On 09/11/2022, Ihor Radchenko wrote: > This is because Org keeps the last newline visible and Emacs apply > :extent t to that visible newline.
I saw the bug report on Emacs, but I am not sure how to reply to a thread there without being subscribed to the mailing list, so I will reply here. I think a possible solution that can be implemented in org-mode side would be for the outline to include the new line character after `#+end_src` to hide the whole line (including the extended background). The final result can then be fixed by adding a newline character to the `...` glyph. Do you think that would work? -- Al