PHP tags mixed with HTML

Could ProseMirror handle PHP mixed with HTML. I’m thinking that it could work similarly to the dino demo except that PHP tags can go anywhere even inside element attributes e,g:

<p <? if($foo){ ?>class="<?=$bar;?>"<? } ?>>hello</p>

Is this possible?

If you are going to edit code, do not use ProseMirror. I mean, you can embed some code in a code block in your document, but it sounds like you are really talking about code editing. For that, use CodeMirror instead.

I’d like to use a CodeMirror instance in conjunction with a ProseMirror instance so that edits made in one of them affects the other. To have them mirror each other, as it were.

You might be able to get something like that going with just HTML, but adding PHP to the mix is not something I’m even going to think about.