User:SiBr4/DiffApostrophes.js

In today's world, User:SiBr4/DiffApostrophes.js is a topic that occupies a central place in conversations and debates in society. Whether in terms of social, economic, political or cultural impact, User:SiBr4/DiffApostrophes.js has captured the attention of people of all ages and walks of life. The relevance and importance of User:SiBr4/DiffApostrophes.js extends globally, and its influence is felt in different areas of daily life. In this article, we will explore the different facets and perspectives surrounding User:SiBr4/DiffApostrophes.js, with the aim of deeply understanding its scope and its implications for the present and the future.

/*

This script adds 0.1em of padding around apostrophes ('') in
diffs, to ease distinguishing them from quotation marks ("). See
].

Install by adding the following row to your ] or ]:

importScript('User:SiBr4/DiffApostrophes.js');

*/

function repapos(elem) {
  elem.innerHTML = elem.innerHTML.replace(/(?<!<+)\'/g,"<span style=\"padding:0 0.1em;\">'</span>");
}
var diff = document.getElementsByClassName("diff");
if (diff) {
  var del = diff.getElementsByClassName("diff-deletedline");
  for (i=0; i<Math.min(del.length,50); i++) {repapos(del);}
  var add = diff.getElementsByClassName("diff-addedline");
  for (i=0; i<Math.min(add.length,50); i++) {repapos(add);}
  var ctx = diff.getElementsByClassName("diff-context");
  for (i=0; i<Math.min(ctx.length,50); i++) {repapos(ctx);}
}