[SOLVED] Can you control code block language via the Admin API?

Hi there,
I currently have a script that uploads content via the admin API as HTML. I have codeblocks with <code language="x">some code</code>.

Is there any way to set the language of the code blocks in my POST request? I am using the JavaScript SDK.

Thanks!

<pre>
    <code class="language-x">...</code>
</pre>

Hey there - I uploaded this HTML snippet and it did not seem to set the language of the code block properly

<pre><code class="python">def fn():
	a = 100
	b = 200
		for i in range(10):
			print(i)</code></pre>

You’re missing the language- part of the class, e.g. <code class="language-python">

1 Like

Thank you @Kevin! My mistake, I thought language-x is how you were referring to the language itself.