php endforeach, endif和endwhile与html结束标签混淆


Sublime Text 2 php endforeach, endif, and endwhile get confused widh html closing tag

所以问题基本上是自动缩进。我在f12

的自动缩进的用户配置中使用了这个

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} }

在somefile.php中加上html代码和php代码

<div>
    <?php if(something):?>
         hello world
    <?php endif;?>
</div>

F12结果

<div>
    <?php if(something):?>
        hello world
<?php endif;?> //sublime is thinking the endif is a closing html tag.
</div>

有办法解决这个问题吗?

尝试更改为:

<div>
<?php 
    if(something){
      echo "hello world" // I assume you want to print this line to the screen
    }
 ?>
</div>