markup icon indicating copy to clipboard operation
markup copied to clipboard

Redundant newline inside code blocks in org mode

Open alexander-yakushev opened this issue 9 years ago • 5 comments

A rendered source code block contains an extra newline with four spaces at the end of it. It applies to both blocks created by #+BEGIN_SRC and :.

Example: https://github.com/grammarly/omniconf/blob/master/README.org#usage

alexander-yakushev avatar Feb 05 '16 07:02 alexander-yakushev

Does anyone have a workaround for this?

martinbaillie avatar Dec 02 '19 05:12 martinbaillie

This org file example. shows some of the possible workarounds to solve this problem.

juanscr avatar Aug 07 '20 23:08 juanscr

I'm linking this Community topic to help myself understand how the : character results in the behavior we see.

The proposed workaround above is cool, but only solves for the whitespace, and not for the :... the original example also seems to have been resolved?

This can also be seen, here:

https://github.com/NightMachinary/TEMP_T1/tree/master

nethgato avatar Oct 21 '20 21:10 nethgato

@nethgato I've created an org file example. showing the comparisons using a src block and using : on which cases the whitespaces appear and which do not.

Both spaces are generated by the same issue of having spaces at the end or before the start of the block.

juanscr avatar Oct 22 '20 05:10 juanscr

Editing this comment to better communicate the problem. For this user, the whitespace is autogenerated by org-babel in Emacs. Manual removal of the whitespace after the fact will only be overridden whenever an update happens.

They have a workaround themselves by using setq org-babel-min-lines-for-block-output 0 in Emacs, but are hoping that we can identify when that whitespace exists and adjusting for it on our end.

It's not urgent at all, but wanting to document the behavior and expectation our user has, since it's a public post.

nethgato avatar Oct 22 '20 19:10 nethgato

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Dec 18 '24 12:12 github-actions[bot]