"Run all chunks above" tries to run css block

When I try to use the chunk toolbar button to "Run all chunks above", I get an error on my first chunk which is css.
That's fair enough since it shouldn't work as executable code,
except it seems like the correct behavior would be to not execute that chunk.

I have tried setting the chunk option "eval=FALSE", but that doesn't change anything, which makes sense since those are knitter options and not IDE execution options.

Is there a way to change this or a good workaround ?

Try placing CSS at top, outside the chunk. Should render as HTML

Thanks for your reply.

I'm not quite sure I understand. It isn't really a question about rendering but about "Run all chunks above" in the IDE.
Is that what you're talking about?
If so, what does it mean to place CSS at top?

You aren’t using Quarto or RMarkdown?

I'm using RMarkdown in RStudio.

Maybe I figured out your point.
To work around the problem css chunk execution,

  • I removed the css chunk entirely
  • and put it without a chunk inside a raw style tag

This renders fine on knit, and of course no longer has the execution problem in the RStudio IDE.

1 Like

It should also work outside chunks, along with HTML markup

1 Like

I believe you still encounter this issue

or similar in the IDE

Yes - I can also comment there that the css is a problem in 2022.07.2 Build 576

Or I guess it's not necessary as it's reopened and confirmed :+1:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.