Download your favorite Linux distribution at LQ ISO.
Go Back > Projects > > Feature
User Name


Additional languages for code syntax highlighting Issue Tools
issueid=120 01-11-2011 03:10 AM
Additional languages for code syntax highlighting
e.g. for more common languages like C/C++, Python, etc.

I notice that pretty much the only language here that has a BBCode tag for syntax highlighting is PHP (with the [php][/php] tags). It would be nice if syntax highlighting for additional, more common languages could be added.

Er, by "more common", I mean that from what I've seen, PHP code isn't posted nearly as often as C/C++, shell scripts, Python/other non-shell interpreted languages, etc. Plus which I doubt many actually use the special tags even when they are posting actual PHP code (they'll just use the normal [code][/code] tags).

I'm thinking a way of doing this might be to include a "lang=" option in the tag, for example:

[code lang=c]<C code to be highlighted here>[/code]
Just something to consider...maybe?
Issue Details
Issue Type Feature
Category Forums
Status Suggested
Priority 4
Suggested Version Unknown
Implemented Version (none)
Votes for this feature 2
Votes against this feature 0
Assigned Users (none)
Tags (none)

01-11-2011 05:47 PM
Senior Member
Yes, it would definitely be a good thing. However, I think the 'lang' option is unnecessary; it just needs to be:

[code="some language"]

or the like, the same way quoted blocks of text are.

Issue Tools
Subscribe to this issue


All times are GMT -5. The time now is 04:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration