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).html.slice($(this).html.indexOf("/*") +2, $(this).html.indexOf("*/"));	$(this).attr("id", encodeURIComponent($.trim(anchorID).replace(/ /g, "_")).replace(/%/g, ".")).css("background-color", "#F88"); });