From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

(function ($, mw){

	mw.loader.load( '//en.wikipedia.org/?title=User:Danski454/code-link.css&action=raw&ctype=text/css', 'text/css' );



	function doWikilinks(){

		$(".c, .c1, .cm").each(function(){

			var text = $(this).html();

			var match;

			var re = /\[\[(([^[\]|<>{}]+)(?:\|.*?)?)\]\]/;

			while(text.match(re)){

				match = text.match(re);

				var url = mw.config.get("wgArticlePath").replace("$1",

					encodeURIComponent(match2].replace("&quot;", '"').replace("&#x27;", "'")

					.replace("&#x2F;", "/").replace("&amp;", "&").replace(" ", "_")));

				text = text.replace(match0], '[[<a class="code-link" href="' + url + '">' + match1 + '</a>]]');

			}

			$(this).html(text);

		});

	}

	

	function doExternalLinks(){

		$(".c, .c1, .cm").each(function(){

			var text = $(this).html();

			var match;

			var re = /( |^)(\w+:\/\/[^ <>]+)/;

			while(text.match(re)){

				match = text.match(re);

				var url = match2].replace("&quot;", '%22').replace("&#x27;", "'").replace("&#x2F;", "/").replace("&amp;", "&").replace("&lt;", "<").replace("&gt;", ">");

				text = text.replace(match0], match1 + '<a class="code-link" href="' + url + '">' + match2 + '</a>');

			}

			$(this).html(text);

		});

	}

	

	$(document).ready(function(){

		if ( mw.config.get("wgIsArticle") && "javascript", "css", "Scribunto"].indexOf(mw.config.get("wgPageContentModel")) !== -1 ){

			doWikilinks();

			doExternalLinks();

		}

	});

	

})(jQuery, mediaWiki);
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

(function ($, mw){

	mw.loader.load( '//en.wikipedia.org/?title=User:Danski454/code-link.css&action=raw&ctype=text/css', 'text/css' );



	function doWikilinks(){

		$(".c, .c1, .cm").each(function(){

			var text = $(this).html();

			var match;

			var re = /\[\[(([^[\]|<>{}]+)(?:\|.*?)?)\]\]/;

			while(text.match(re)){

				match = text.match(re);

				var url = mw.config.get("wgArticlePath").replace("$1",

					encodeURIComponent(match2].replace("&quot;", '"').replace("&#x27;", "'")

					.replace("&#x2F;", "/").replace("&amp;", "&").replace(" ", "_")));

				text = text.replace(match0], '[[<a class="code-link" href="' + url + '">' + match1 + '</a>]]');

			}

			$(this).html(text);

		});

	}

	

	function doExternalLinks(){

		$(".c, .c1, .cm").each(function(){

			var text = $(this).html();

			var match;

			var re = /( |^)(\w+:\/\/[^ <>]+)/;

			while(text.match(re)){

				match = text.match(re);

				var url = match2].replace("&quot;", '%22').replace("&#x27;", "'").replace("&#x2F;", "/").replace("&amp;", "&").replace("&lt;", "<").replace("&gt;", ">");

				text = text.replace(match0], match1 + '<a class="code-link" href="' + url + '">' + match2 + '</a>');

			}

			$(this).html(text);

		});

	}

	

	$(document).ready(function(){

		if ( mw.config.get("wgIsArticle") && "javascript", "css", "Scribunto"].indexOf(mw.config.get("wgPageContentModel")) !== -1 ){

			doWikilinks();

			doExternalLinks();

		}

	});

	

})(jQuery, mediaWiki);

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook