We’ve enabled syntax highlighting support for forum posts for communities. (Any place where a comment is rendered inside of itch.io’s UI)
Syntax highlighting is performed client-side using the Prism library. We’ve exported the library with every single language it supports. You can activate syntax highlighting by having a pre tag with the class
language-XXX on it (where
XXX is the language you wish to highlight for.
local function hello_world() print("Hello world") end
For markdown we support using the
```language syntax that is available on other platforms like GitHub.
For those using the rich text editor, you will have to manually edit the HTML to add the class at the time being.
Note: This is not yet available in comments yet, because we need to test compatibility with themed pages.