~cytrogen/masto-fe

ref: ba73f0ea3a0bcfc21dc8f0111eac4f0bce7101ca masto-fe/app/javascript/flavours/glitch/utils/html.js -rw-r--r-- 232 bytes
ba73f0ea — Claire [Glitch] Add polling and automatic redirection to `/start` on email confirmation 2 years ago
                                                                                
1
2
3
4
5
export const unescapeHTML = (html) => {
  const wrapper = document.createElement('div');
  wrapper.innerHTML = html.replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n').replace(/<[^>]*>/g, '');
  return wrapper.textContent;
};