shazbot,

Would you like to add this to KES? You can use KES' propagation feature to ensure it applies to comments loaded in on the fly when infinite scrolling is enabled without needing to worry about page load events.

May I also suggest something more idiomatic like the below?

const code = document.querySelectorAll('pre code');
const reg = /^n<span style="color:#323232;">/g
const reg2 = /n</span><span style="color:#323232;">/g
const reg3 = /</span>n$/

code.forEach((block)=> {
    let str
    str = block.innerText;
    str = str.replaceAll(reg, "");
    str = str.replaceAll(reg2, "n");
    str = str.replace(reg3, "");
    block.innerText = str;
});

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • wartaberita
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • [email protected]
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • TheResearchGuardian
  • Ask_kbincafe
  • KbinCafe
  • Testmaggi
  • Socialism
  • feritale
  • oklahoma
  • SuperSentai
  • KamenRider
  • All magazines