MediaWiki:Common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener("DOMContentLoaded",function(){var e=document.querySelector("h2 > span#Steps");console.log("Steps header:",e);if(e){var t=e.parentElement.nextElementSibling;console.log("Adjacent ordered list:",t);if(t&&t.tagName==="OL"){var n=t.querySelectorAll("li");for(var o=0;o<n.length;o++){var l=n[o];console.log("Processing <li> "+(o+1)+":",l.textContent.trim());var r=l.textContent.trim(),i=r.indexOf(".")+1;if(i>0){var c=r.slice(0,i),a=r.slice(i).trim();l.innerHTML="<strong>"+c+"</strong> "+a,console.log("Updated <li> "+(o+1)+":",l.innerHTML)}else console.log("No sentence found in <li> "+(o+1))}}else console.log("No <ol> found as the adjacent sibling of the Steps header")}else console.log("No h2 > span#Steps element found")});