I think the topic was closed before the issue was dealt with.
I simply replaced your ‘div’ (and the class = etc) with the HTML element ‘code’.
Thereby mixing HTML into the paragraph. It turned the P red (as it ought) and then continued with the rest of the paragraph formatted as it should be. I noticed that your HTML seemed to move the P to the line above the rest of the paragraph.
From my extraordinarily limited knowledge of HTML, that depends.
Div is a block element, thereby making the whole paragraph an HTML block.
Inline HTML elements (eg code) will work with markdown outside the HTML.