I was expecting a solution from the developers of notepad++, by bringing back the feature of highlighting html code inside php code. But that is not happening... So got a temporary workaround:
1) Open php file in notepad++
2) Set HTML languahe: go to Language => H => HTML
3) Now html tags are highlighted in php code.
If you will close and open once again the php file, you will have to execute 1-3 again.
To make this automatically done:
EDIT langs.xml
1) Replace
<Language name="html" ext="html htm shtml shtm xhtml hta"
with
<Language name="html" ext="html htm shtml shtm xhtml hta php"
That will make php files to be parsed as html language
2) Replace
<Language name="php" ext="php php3 phtml"
with
<Language name="php" ext="php1 php3 phtml"
That will disable php files to be parsed as php language. If not doing step 2 => step 1 has no effect.
EDIT functionList.xml:
Function list will be empty after those changes. Here is the fix: Need to edit functionList.xml
1) Replace:
<association langID="6" id="java"/> <association langID="9" id="xml_node"/>
with
<association langID="6" id="java"/> <association langID="8" id="html_function"/> <association langID="9" id="xml_node"/>
2) just after last is closed, add this (it's a copy of php_function renamed to html_function):
<parser id="html_function" displayName="PHP" commentExpr="((/\*.*?\*)/|(//.*?$))"> <classRange mainExpr="^[\s]*(class|abstract[\s]+class|final[\s]+class)[\t ]+[\w]+([\s]*|[\s]*(extends|implements)[\s]+[\w\\]+[\s]*)?\{" openSymbole = "\{" closeSymbole = "\}" displayMode="node"> <className> <nameExpr expr="(class|abstract[\s]+class|final[\s]+class)[\s]+[\w]+"/> <nameExpr expr="[\s]+[\w]+\Z"/> <nameExpr expr="[\w]+\Z"/> </className> <function mainExpr="^[\s]*((static|public|protected|private|final)*(\s+(static|public|protected|private|final))+[\s]+)?(function[\s]+)+([\w]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+))?([\w_]+[\s]*::)?(?!(if|while|for|switch))[\w_~]+[\s]*\([^\{]*\{"> <functionName> <funcNameExpr expr="(?!(if|while|for|switch))[\w_]+[\s]*\([^\{]*"/> <!-- comment below node if want display method with parmas --> <funcNameExpr expr="(?!(if|while|for|switch))[\w_]+"/> </functionName> </function> </classRange> <function mainExpr="^[\s]*function[\s]+\w+\(" displayMode="$className->$functionName"> <functionName> <nameExpr expr="(?!(if|while|for))[\w_]+[\s]*\("/> <nameExpr expr="(?!(if|while|for))[\w_]+"/> </functionName> <className> <nameExpr expr="[\w_]+(?=[\s]*::)"/> </className> </function> </parser>
EDIT \plugins\APIs\html.xml and \plugins\APIs\php.xml (this is needed for notepad++ version 6.9.1 and above)
1) Copy content in php.xml between <AutoComplete>...</AutoComplete> and paste it to html.xml, before </AutoComplete>
Я только что увидел эту строку в журнале изменений, по-видимому, ранее это считалось ошибкой: 9. Исправьте ошибку сопоставления тегов, отключив сопоставление тегов внутри блоков кода PHP.