User:Javascripttest/highlightshortdiffs.js

// Get all and tags with the class 'diffchange' const insTags = document.querySelectorAll('ins.diffchange'); const delTags = document.querySelectorAll('del.diffchange');

// Function to apply styles to diff tags function applyStylesToDiffTags(tags) { tags.forEach(tag => {   tag.style.borderBottom = '1px solid black';    tag.style.backgroundColor = 'red';  }); }

// Check if the combined length of tags is less than 5 const insCombinedLength = Array.from(insTags).reduce((totalLength, insTag) => { const contentLength = insTag.innerHTML.length;  if (contentLength < 5) {    applyStylesToDiffTags([insTag]);  }  return totalLength + contentLength; }, 0);

// Check if the combined length of tags is less than 5 const delCombinedLength = Array.from(delTags).reduce((totalLength, delTag) => { const contentLength = delTag.innerHTML.length;  if (contentLength < 5) {    applyStylesToDiffTags([delTag]);  }  return totalLength + contentLength; }, 0);