Using highlight with rmarkdown

As you can see in this example site, hugo clarity theme has native code folding, code copying and line number. But it won’t work with rmarkdown code blocks which looks like inline code.

Code blocks in that example site are enclosed like:


## code goes here ##


while rmarkdown code blocks are enclosed like:

<pre class=“r”><code>

## code goes here ##


Is there a way to enable those features with (pre) instead of code fences?

I am afraid that this is not currently possible.

Is there at least a way (via css) to make code class inherit pre class? I guess that would allow highlight.js to work properly.