MediaWiki:Common.css: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/ | // Load Prism.js (ensure correct path) | ||
importScriptURI('/prism.js'); // Adjust if necessary | |||
// Optional: log to check if Prism.js is loaded | |||
if (typeof Prism !== "undefined") { | |||
console.log("Prism.js loaded successfully."); | |||
} else { | |||
console.error("Prism.js is not loaded."); | |||
} | |||
// Initialize syntax highlighting after page load | |||
$(document).ready(function() { | |||
if (typeof Prism !== "undefined") { | |||
Prism.highlightAll(); | |||
console.log("Prism.js executed successfully on all code blocks."); | |||
} else { | |||
console.error("Prism.js not found when trying to highlight code."); | |||
} | |||
}); | |||
Revision as of 10:43, 18 January 2025
// Load Prism.js (ensure correct path)
importScriptURI('/prism.js'); // Adjust if necessary
// Optional: log to check if Prism.js is loaded
if (typeof Prism !== "undefined") {
console.log("Prism.js loaded successfully.");
} else {
console.error("Prism.js is not loaded.");
}
// Initialize syntax highlighting after page load
$(document).ready(function() {
if (typeof Prism !== "undefined") {
Prism.highlightAll();
console.log("Prism.js executed successfully on all code blocks.");
} else {
console.error("Prism.js not found when trying to highlight code.");
}
});