You are here: PSPad forum > English discussion forum > PHP in JavaScript Multihighlighter

PHP in JavaScript Multihighlighter

#1 PHP in JavaScript Multihighlighter

Posted by: calamity | Date: 03/30/2012 12:16 | IP: IP Logged

Hi guys,

PHP is not highlighted properly when used between <script> tags. It seems PSPad doesn't detect it is PHP.

Is that a bug, and if it is, is there a fix?

Best Regards,
Slavi

Options: Reply | Quote | Up ^


#2 Re: PHP in JavaScript Multihighlighter

Posted by: carbonize | Date: 03/30/2012 12:34 | IP: IP Logged

Because PHP needs to be between <?php and ?> and is not a script a browser would recognise. The script tags are just used to tell the browser that the code there is something it can pas to it's scripting engine, usually JavaScript or VBScript.

--
Carbonize

Options: Reply | Quote | Up ^


#3 Re: PHP in JavaScript Multihighlighter

Posted by: calamity | Date: 03/30/2012 12:56 | IP: IP Logged

Maybe an example will clarify things a bit.

<html>
...
<script>
var a = <?php echo $avalue; ?>;
</script>
...
</html>

It is not a big issue here, because it's only "echo $avalue", but larger portions of php code are not properly highlighted either.

Regards

Options: Reply | Quote | Up ^


#4 Re: PHP in JavaScript Multihighlighter

Posted by: calamity | Date: 04/10/2012 09:49 | IP: IP Logged

The same problem appears when trying to put <?php ?> between <style></style> tags -- no php syntax highlighting.

Best regards,
me

Options: Reply | Quote | Up ^


#5 Re: PHP in JavaScript Multihighlighter

Posted by: pspad | Date: 04/10/2012 19:49 | IP: IP Logged

There isn't and won't be multilevel highlighting

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2013 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák