[Feature] Implement a feature equivalent to Syntax Higlight
- PsySc0rpi0n
- Posts: 294
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 1 time
- Been thanked: 1 time
[Feature] Implement a feature equivalent to Syntax Higlight
Hi...
As far as I know, in the Programming section, it is still not possible to have Syntax Highlight for programming languages. I think this could be a very useful feature when someone want to post a piece of code. Syntax Highlight makes the code way easier to read and if we use dark modes in the forum, the code is all in read with a dark background which makes it even harder to read, in my opinion.
I bet that this was already suggested by someone but I couldn't find anything in this sub-forum, so I created a new thread on the suject.
So, why don't we have that feature? Is it too hard to implement or this forum doesn't support it?
As far as I know, in the Programming section, it is still not possible to have Syntax Highlight for programming languages. I think this could be a very useful feature when someone want to post a piece of code. Syntax Highlight makes the code way easier to read and if we use dark modes in the forum, the code is all in read with a dark background which makes it even harder to read, in my opinion.
I bet that this was already suggested by someone but I couldn't find anything in this sub-forum, so I created a new thread on the suject.
So, why don't we have that feature? Is it too hard to implement or this forum doesn't support it?
Re: [Feature] Implement a feature equivalent to Syntax Higlight
Hello PsySc0rpi0n,
As you pointed out, the lack of syntax highlighting in programming forums can indeed make reading and understanding code more challenging, especially with dark mode themes.
While this feature isn't natively implemented in the forum, a temporary workaround could be to create a script, plugin, or browser extension that personalizes your experience.
As a Linux developer, you might be familiar with manipulating the Document Object Model (DOM) via JavaScript.
This approach allows you to alter the presentation of code in forum posts. For instance, you could develop a script that identifies code tags and applies syntax highlighting based on the programming language used.
Sharing such a script or plugin with the forum community could be a great way to assist other members facing the same issue. While a custom solution won't be visible to all forum users, it can significantly enhance your reading experience and that of others who are interested.
Implementing something akin to Markdown for syntax highlighting isn't overly complex, but it requires knowledge in JavaScript and an understanding of the specific forum's structure.
Personally, I often find copying the code into my own editor, where syntax highlighting is available, to be a practical workaround, but I recognize that having syntax highlighting directly in the forum would be a valuable addition.
I hope this suggestion is helpful, and I'm here to assist further if you have more questions or need additional guidance in developing this solution.
Best regards,
MrNordio
As you pointed out, the lack of syntax highlighting in programming forums can indeed make reading and understanding code more challenging, especially with dark mode themes.
While this feature isn't natively implemented in the forum, a temporary workaround could be to create a script, plugin, or browser extension that personalizes your experience.
As a Linux developer, you might be familiar with manipulating the Document Object Model (DOM) via JavaScript.
This approach allows you to alter the presentation of code in forum posts. For instance, you could develop a script that identifies code tags and applies syntax highlighting based on the programming language used.
Sharing such a script or plugin with the forum community could be a great way to assist other members facing the same issue. While a custom solution won't be visible to all forum users, it can significantly enhance your reading experience and that of others who are interested.
Implementing something akin to Markdown for syntax highlighting isn't overly complex, but it requires knowledge in JavaScript and an understanding of the specific forum's structure.
Personally, I often find copying the code into my own editor, where syntax highlighting is available, to be a practical workaround, but I recognize that having syntax highlighting directly in the forum would be a valuable addition.
I hope this suggestion is helpful, and I'm here to assist further if you have more questions or need additional guidance in developing this solution.
Best regards,
MrNordio
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel
- sunrat
- Administrator
- Posts: 6041
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 105 times
- Been thanked: 377 times
Re: [Feature] Implement a feature equivalent to Syntax Higlight
I just had a look in our admin control panel. There does not appear to be an option for syntax highlighting.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
- PsySc0rpi0n
- Posts: 294
- Joined: 2012-10-24 13:54
- Location: Bitcoin World
- Has thanked: 1 time
- Been thanked: 1 time
Re: [Feature] Implement a feature equivalent to Syntax Higlight
@mrnordio2, unfortunately I have no knowledge whatsoever in JavaScript. I don't even consider myself as a Linux developer although I use to work with programming, but my skills are very limited.
If someone has any JavaScrpit knowledge, it would be awsome to see such add-on for this forum!
I found this very old post about syntax highlight in phpBB:
https://www.phpbb.com/community/viewtopic.php?t=2388331
Seems that it simply has no interest in the community, otherwise phpBB would support it already or someone would have already built a solution!
Edited;
Also found this:
https://github.com/s9e/phpbb-ext-highlighter
Would this one be useful?
If someone has any JavaScrpit knowledge, it would be awsome to see such add-on for this forum!
I found this very old post about syntax highlight in phpBB:
https://www.phpbb.com/community/viewtopic.php?t=2388331
Seems that it simply has no interest in the community, otherwise phpBB would support it already or someone would have already built a solution!
Edited;
Also found this:
https://github.com/s9e/phpbb-ext-highlighter
Would this one be useful?
- donald
- Debian Developer, Site Admin
- Posts: 887
- Joined: 2021-03-30 20:08
- Has thanked: 165 times
- Been thanked: 202 times
Re: [Feature] Implement a feature equivalent to Syntax Higlight
The pastebin feature does do the syntax highlighting but unfortunately that feature does not incorporate with the actual forum software.
app.php/pastebin/?mode=view&s=66
app.php/pastebin/?mode=view&s=66
Typo perfectionish.
Re: [Feature] Implement a feature equivalent to Syntax Higlight
Hey PsySc0rpi0n and all,
Totally agree that a script, plugin, or even a browser extension could be a game-changer for reading code on the forum. It's clear how much easier it makes things, especially for those of us who live and breathe code.
Right now, my plate's pretty full with a bunch of projects, but I'm really into the idea of helping out with this. Building tools like these is right up my alley. Just gotta be upfront though, I'm juggling quite a bit at the moment.
I'm keen to dive into this when things ease up on my end. In the meantime, if anyone's itching to get started or has some ideas, I'm all ears and ready to chip in where I can. You know how it is – when we team up, we usually get things done faster and better.
I'll definitely keep an eye on this thread and jump in with both feet when I've got a bit more room on my schedule.
Excited to see where we can take this!
Catch you guys later.
Totally agree that a script, plugin, or even a browser extension could be a game-changer for reading code on the forum. It's clear how much easier it makes things, especially for those of us who live and breathe code.
Right now, my plate's pretty full with a bunch of projects, but I'm really into the idea of helping out with this. Building tools like these is right up my alley. Just gotta be upfront though, I'm juggling quite a bit at the moment.
I'm keen to dive into this when things ease up on my end. In the meantime, if anyone's itching to get started or has some ideas, I'm all ears and ready to chip in where I can. You know how it is – when we team up, we usually get things done faster and better.
I'll definitely keep an eye on this thread and jump in with both feet when I've got a bit more room on my schedule.
Excited to see where we can take this!
Catch you guys later.
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel
- donald
- Debian Developer, Site Admin
- Posts: 887
- Joined: 2021-03-30 20:08
- Has thanked: 165 times
- Been thanked: 202 times
Re: [Feature] Implement a feature equivalent to Syntax Higlight
@mrnordio2 There is actually an unvalidated phpBB mod that can do this, but we are wary of installing it because it could potentially expose security holes in the forum. But if you could, please take a peek at it: https://github.com/s9e/phpbb-ext-highlighter
Typo perfectionish.
Re: [Feature] Implement a feature equivalent to Syntax Higlight
Thank you for pointing out the s9e/phpbb-ext-highlighter on GitHub.
It seems like a promising solution for adding syntax highlighting.
Safety is paramount, and it's wise to be wary of potential vulnerabilities.
I'll take a closer look at the extension, considering the security aspects you mentioned.
We'll enhance our forum's functionality while ensuring our community's digital safety.
Looking forward to exploring this further!
It seems like a promising solution for adding syntax highlighting.
Safety is paramount, and it's wise to be wary of potential vulnerabilities.
I'll take a closer look at the extension, considering the security aspects you mentioned.
We'll enhance our forum's functionality while ensuring our community's digital safety.
Looking forward to exploring this further!
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel
- sunrat
- Administrator
- Posts: 6041
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 105 times
- Been thanked: 377 times
Re: [Feature] Implement a feature equivalent to Syntax Higlight
Maybe a Tampermonkey or Greasemonkey script would be a safer alternative and only needs to be installed by those who want it. There are several for other sites on GitHub which could be adapted.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Re: [Feature] Implement a feature equivalent to Syntax Higlight
My response is almost what I would have said in my own words. I am here to assist those asking questions, not the AI platforms. The answers I provide, which offer multiple alternatives for solving problems, are even better than what I would have envisioned. I'm helping those in need, with good intentions, and I hope you are not bothered by the time I dedicate to helping others without expecting anything in return. You should be doing the same instead of posting criticisms with contempt and devaluing the time I spend reviewing each response.
In case any moderator, or administrator disagrees with my initiative and prefers that I am not here, just let me know and I will stop. Otherwise, I suggest that you focus more on your own life instead of monitoring how many responses, in what time frame, and from which account are being posted.
@sunrat
@donald
In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel
- donald
- Debian Developer, Site Admin
- Posts: 887
- Joined: 2021-03-30 20:08
- Has thanked: 165 times
- Been thanked: 202 times
Re: [Feature] Implement a feature equivalent to Syntax Higlight
I do not have any issues thus far with any posters as long as everyone behaves and is cordial to each-other. We don't all write the same language and for some users translators are a valid tool to make an attempt to speak in the forum primary language, lets give each other the benefit of the doubt until absolutely proven otherwise.
Typo perfectionish.
Re: [Feature] Implement a feature equivalent to Syntax Higlight
Thank you for the reply and explanation of your methods. As for your statement "posting criticisms with contempt and devaluing the time I spend" - there is nothing like that in my comment, it contains nothing except statement of fact, it was not my intention to imply something like that.
Please don't get personal pointing out on what I should focus on and what I should be doing .
Re: [Feature] Implement a feature equivalent to Syntax Higlight
My intention in responding to various posts is to provide helpful and constructive solutions to the problems or questions raised by forum members. I aim to offer insights that are not only useful but also encompass a range of perspectives and options.vng2022 wrote: ↑2023-11-26 09:57Thank you for the reply and explanation of your methods. As for your statement "posting criticisms with contempt and devaluing the time I spend" - there is nothing like that in my comment, it contains nothing except statement of fact, it was not my intention to imply something like that.
Please don't get personal pointing out on what I should focus on and what I should be doing .
I understand your concern about the authenticity of the responses. Please rest assured that my contributions are made with the best intentions, focusing on aiding our community. I value the interaction and exchange of ideas in our forum, and my goal is to enrich these discussions with meaningful and relevant information.
Let's continue to work together in a spirit of cooperation and mutual understanding. If you have any further questions or concerns, please don't hesitate to share them.
If there's any specific aspect of my responses or any topic you'd like to discuss further, I'm more than happy to engage in a constructive dialogue. It's all about learning from each other and growing as a community.

In a world of 1s and 0s, I am the exceptional exception. Linux isn't just my platform; it's my playground. #MasterOfTheKernel