Page 1 of 1

Is PHP syntax highlighting gone?

Posted: Thu Aug 04, 2016 11:47 am
by Profo
I'm still doing some local tests, but I realized that all PHP syntax highlighting colours are gone after upgrading from 3.1.

An example:

Code: Select all

require($phpbb_root_path . 'includes/startup.' . $phpEx);
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
The code above is properly highlighted in 3.1 using [code=php], but in 3.2 renders as standard code (not highlighted).

Has this changed somehow (maybe a different BBcode) or is it gone?

Re: Is PHP syntax highlighting gone?

Posted: Thu Aug 04, 2016 11:51 am
by JimA
Yes, phpBB 3.2 uses an external library for its BBCode parsing, which no longer includes syntax highlighting.

Re: Is PHP syntax highlighting gone?

Posted: Thu Aug 04, 2016 12:04 pm
by Profo
Ah, OK. Thanks JimA!

BTW I would suggest to update the BBCode FAQ language files, specially this part:
PHP syntax highlighting can be enabled using ... and is recommended when posting PHP code samples as it improves readability.

Re: Is PHP syntax highlighting gone?

Posted: Thu Aug 04, 2016 12:52 pm
by JimA
Could you please report that idea to the Bug Tracker so our developers can take that into consideration? :)

Re: Is PHP syntax highlighting gone?

Posted: Thu Aug 04, 2016 1:13 pm
by Profo
Done!

Re: Is PHP syntax highlighting gone?

Posted: Fri Aug 05, 2016 12:43 am
by KaileyT
There is an (unreleased) extension I found a while back that would enable syntax highlighting in 3.2 - not just PHP. I'll see if I can find it again.

Re: Is PHP syntax highlighting gone?

Posted: Fri Aug 05, 2016 2:33 am
by Puchahawa
This may be the one Kinerity is thinking about. It's called Codebox plus. :)

Re: Is PHP syntax highlighting gone?

Posted: Fri Aug 05, 2016 3:18 am
by KaileyT
I said "unreleased" - as in it was never even posted here. ;)

Anyway, I found it (link). I did some quick testing and it does seem to work.

Code: Select all

[code]<?php
print 'Hello World!';
?>
[/code]
code.png
code.png (4.29 KiB) Viewed 1044 times

Re: Is PHP syntax highlighting gone?

Posted: Fri Aug 05, 2016 10:02 am
by JoshyPHP
It's funny, I forgot about that extension. I published it on GitHub a year ago but I don't really intend to maintain it. Fortunately, it shouldn't require any maintenance since all it does is add a little script to the prosilver style. I've just updated it for highlight.js 9.5.0.