User:Þjarkur/Highlight homographs in title.js

/*  Highlight Unicode tricks to bypass creation protection, such as at Artem Kahаn (one of the A's is a Cyrillic a)  CC0 $.ready.then(function {

if (   mw.config.get('wgNamespaceNumber') !== 0 &&    mw.config.get('wgNamespaceNumber') !== 118  ) return;

$('#firstHeading').contents.each(function {    if (this.nodeType === Node.TEXT_NODE) {      var text = $(this).text      var newText = text.split('').map(i => { if (         /* Cyrillics */          /[\u0400-\u04FF\u0500-\u052F\u2DE0-\u2DFF\uA640-\uA69F\u1D2B\u1D78]/.test(i) ||          /* Greek */          /[ονɑΑΒΕΗΙΚΜΝΟΡΤΧΥΖ]/.test(i) ||          /* Armenian */          /[օոսՏԼ] /.test(i)        ) { return ` ${i} ` }       return i      }).join('')      if (text !== newText) {        $(this).replaceWith(newText + ' Note: The highlighted letter in the title is a homograph, the current title may be evading watchlists. ')     }    }  }) })