Got another repro for you:
Working:
<script type="text/javascript">
'<>'
<?php echo 'hi'; ?>
</script>
Not working:
<script type="text/javascript">
'<'
<?php echo 'hi'; ?>
</script>
I recognize that the mixed context problem here (php in javascript in php etc) can be particularly troublesome 😅
It appears that a quoted <
character that isn't closed is treated as the start of some html in some contexts. For example, '<'+'>'
also breaks. It also breaks if it's in a javascript comment, for example. My guess is that the extension is not treating literal javascript as javascript (or a block of unknown content) and is instead just thinking the contents are HTML. However, strangely, if you comment or remove the <?php .. ?>
bit, formatting also works. They both need to be present to fail. If you put the '<'
after the <?php .. ?>
block, it formats.