Netbeans has a great code formatting feature, the command is here: Source -> Format (ALT + SHIFT + F)
This perfectly formats the code (HTML, PHP, CSS, JS ...), but not in the case of multi-language (PHP + HTML) code — in this case, formatting most often does not give a good result .
Example code: here
PHP + HTML is a reality of my work (I work with CMS Bitrix).
Is there an adequate solution to this problem?