Add a Code Block to the Forum
417
Views
7
Comments
New
Forums

It happens frequently that you want to past code in a Forum post. This can be SQL, CSS, HTML, C# or something else. At the moment this code is pasted as normal text and is taking the styling of a normal text. For code this is not wanted. 

Please add a Code Block that uses a style that is normal for code. So it is using a monospaced font, have indentation support, colorization of the different elements in the code block of readability, allow to copy the code, etc etc. 

HighlightJS is one of the big frameworks that provide support for this. Perhaps it is possible to integrate with this?

A few examples of working code blocks are;


Merged this idea with 'Context should have Code area' (created on 06 Nov 2023 10:04:55 by Prince Aadil Khan Panwar)

The idea is if i want to add some code for example javascript code or C# in the post or any reply so the code becomes mess. the solution is there should have code area so the user can write the code in proper way. 

hi Damian Fonville ,

I did not have any idea about that. but i was facing all the time this issue while posting in forums or replying any post. so i just added as idea. 

Thanks

Prince

Nice to have this element. I have always wanted to.

I believe this is still necessary and would be a valuable addition, especially since many components and use cases require custom JavaScript to extend their capabilities.

A code block would be very nice for forum posts and together with that I would also wish for having an inline code style or at least monospace to highlight e.g. action or variable names in the text.