First of all, thanks to @riking for the solution to make syntax highlighting inside a list item.
But for me it works only for the first code block inside a list item and for some reason does not work for the next code block inside the same list item.
An example of text:
composer.jsonfile in the Magento 2 root folder: change PHP version rule from
composer.lockfile from the Magento 2 root folder.
As you can see, for some reason syntax highlighting works for the first code block but does not work for the second.