Via @DavisVaughan in posit-dev/air#487:
Over in jolars/panache#115 we have been discussing an idea like this where the quarto comments are removed before styling, but when they are added back in an empty line should be added unconditionally between the quarto comments and the rest of the code block. That prevents cases like the above from looking so confusing. Can we make this change in Quarto? It seems like it would be an easy tweak.
So concretely:
If we start here
#| label: my label
## my R comment 1
a <- 1
## my R comment 2
b <- 2
Then we stay there.
If we start here
#| label: my label
## my R comment 1
a <- 1
## my R comment 2
b <- 2
then we add a line and end here
#| label: my label
## my R comment 1
a <- 1
## my R comment 2
b <- 2
if we start here
#| label: my label
a <- 1
b <- 2
we add a line and end here
#| label: my label
a <- 1
b <- 2
i.e. that empty line is unconditionally added to split the quarto directives from the rest of the code, even when there isnt a comment in the code itself
Via @DavisVaughan in posit-dev/air#487: