JSFiddle - React, Tailwind, and code Playground
HTML
<pre>
какой-то текст 1
<code>Code 1</code>
</pre>
<pre>
<code>Code 2</code>
какой-то текст 2
</pre>
CSS
.highlight { color:red; }
JavaScript
var els = document.getElementsByTagName('pre');
for (var i = 0; i < els.length, e = els[i]; i++)
{
if (child = e.firstChild) {
while (child.nodeType == 3 && child.nodeValue.trim().length == 0)
child = child.nextSibling;
if (child.nodeType != 3)
child.className += 'highlight';
}
}