79423347

Date: 2025-02-08 14:35:17
Score: 0.5
Natty:
Report link

You need to escape the HTML code, using a package like escape-html.

Alternatively, you may want to use a simple implementation like:

const encodeHTML = (html) =>
  html
    .replace(/&/g, '&')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/'/g, '&#39;')
    .replace(/"/g, '&#34;');

demo: https://livecodes.io/?x=id/8aj5r4bbs9j

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Hatem