79105849

Date: 2024-10-19 20:21:25
Score: 1.5
Natty:
Report link

Do not try escape characters with replace/replaceAll because there is a lot corner cases. Instead, you should use encodeURIComponent (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent). It will replace characters such as &, \ correctly which is already globally tested:

enter image description here

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Single line (0.5):
Posted by: egorgrushin