Difference between revisions of "MediaWiki:Common.js"

From Taskman Wiki
Jump to navigation Jump to search
(Created page with "#Replace linkline spans with individual links $("span.mw-linkline").each(function(index) { let replaceString = $(this).data("format"); $(this).html($(this).html().replace(...")
 
Line 1: Line 1:
#Replace linkline spans with individual links
+
// Replace linkline spans with individual links
 
$("span.mw-linkline").each(function(index) {
 
$("span.mw-linkline").each(function(index) {
 
   let replaceString = $(this).data("format");
 
   let replaceString = $(this).data("format");
 
   $(this).html($(this).html().replace(/(.+?)(<br>|$)/g, `<a href="${replaceString}">$1</a>$2`));
 
   $(this).html($(this).html().replace(/(.+?)(<br>|$)/g, `<a href="${replaceString}">$1</a>$2`));
 
});
 
});

Revision as of 12:59, 15 May 2020

// Replace linkline spans with individual links
$("span.mw-linkline").each(function(index) {
  let replaceString = $(this).data("format");
  $(this).html($(this).html().replace(/(.+?)(<br>|$)/g, `<a href="${replaceString}">$1</a>$2`));
});