MediaWiki:Gadget-codeAnchors.js

var PCM = mw.config.get( "wgTitle" ).substr(mw.config.get( "wgTitle" ).lastIndexOf(".")); if(PCM === ".js"){ PCM = "javascript"; }else if(PCM === ".css"){ PCM = "css"; } $("pre.source-" + PCM).find("span.coMULTI").not(":contains(/\n/)").each(function{	var anchorID = $(this).replace(/\/\* ?/, "").replace(/ ?\*\//, "");	$(this).attr("id", anchorID); }