News for hackers. Stuff that matters.
Re:I created an ephemeral group chat app for strangers by MzHN on Thursday December 28, 2023 @06:14AM (#38792273)
I like to use a small utility function like this and pass user input through it.

  function asTextContent(input) {
    const tempElement = document.createElement('span');
    tempElement.textContent = input;
    return tempElement.innerHTML;
  }
It will let the browser handle the escaping.

There are no comments on this comment yet.