Code Syntax Highlighting Enabled in the Forums

code

We’ve just added a handy new feature to the forums for those who like to present code for others to view. For a while now, you’ve been able to use the [code][/code] markers to wrap code in a container. Now, you can specify what type of code you’re using to enable syntax highlighting, as shown in the attached image.

To enable this, use (in the case of javascript): [code=javascript][/code].¬†Other languages you can specify include¬†js, css, c, cc, cpp, json, cs, java, bash, bsh, csh, sh, cv, py, python, perl, pl, rb, ruby, coffee, and rust. If you don’t want syntax highlighting, you can still use [code][/code] as usual.

Happy coding!


_________
Want something on the XDA Portal? Send us a tip!