Replace the Code Macro with Prism.js
Last modified by superadmin on 2026/11/25 21:24
Make every existing code macro highlight with Prism.js by installing one extension.
Steps
- Go to "Administration > Extensions", search for the Prism.js Code Macro Replacement extension 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.