Modify markdown extra setting

I’m trying to add custom classes to the pre HTML tag using Markdown extra. After reading the fenced code block documentation, it looks like I have to set the code_attr_on_pre variable on the markdown parser to true. There are a few examples here. My 2 questions are

  1. How do I set this variable to true? I’ve tried a few different places in Grav’s own PHP files but haven’t gotten it to work. I don’t know PHP.

  2. It looks like the behavior of adding classes to pre and code is already enabled to some extent because if I enable markdown extra and type

var a = 2;

in markdown, the HTML output is:

<pre class=" language-js">
   <code class=" language-js">
      <span class="token keyword">var</span> a <span class="token operator">=</span> b<span class="token punctuation">;</span>
   </code>
</pre>

Where was this behavior configured? Thanks!