Replace the Code Macro with Prism.js
Last modified by Vincent Massol on 2026/10/20 18:45
Steps
Make every code macro of the wiki highlight its code with Prism.js, by installing the Prism.js Code Macro Replacement extension.
- Go to "Administration > Extensions", search for Prism.js Code Macro Replacement and click "Install". The Prism.js Macro is installed with it.
- Select "Installed extensions" and search for prism: Prism.js Code Macro Replacement is listed as "Installed".

- Open a page that holds a code macro. Its code is now highlighted by Prism.js.

FAQ
Which Code Macro parameters are kept?
language, layout and source work as with the "prism" macro. The title, image, cssClass and width parameters are ignored, and code without a language is displayed without highlighting.
How do I go back to the Code Macro?
Uninstall Prism.js Code Macro Replacement from "Administration > Extensions", then restart XWiki.