about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/util/html.js
blob: 0b646ce58fb41fb0f721f65540610e6ee697d670 (plain) (blame)
1
2
3
4
5
6
export const unescapeHTML = (html) => {
  const wrapper = document.createElement('div');
  html = html.replace(/<br \/>|<br>|\n/g, ' ');
  wrapper.innerHTML = html;
  return wrapper.textContent;
};