User:The Transhumanist/ViewAnnotationToggler.js: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 1:
//This script removes en dashes from list items.
//It is a test script, which will be developed into one for toggling list item annotations.
//Based on a script by Writ Keeper.
 
//This selector grabs all of the <li> elements that are within #mw-content-text, and then does something for each of them
$("#mw-content-text li").each( function (ind, el)
Line 5 ⟶ 9:
var currentText = $(el).contents().filter(function(){return this.nodeType === 3; });
 
//Don'tOnly bother processingprocess if there's nothingsomething there to process
if(currentText.text().length > 0)
{
// replace the character
var newText = currentText.text().replace(/ /g,' XXX ');
//reinsert the updated string back into the DOM