How to disable javascript: on links href? [closed]

  html, javascript

I got this system where users can input simple markdown. Part of this markdown is inputting links using [text](a link) syntax. But I want to disable the functionality of links that use js with javascript:. Filtering new text being markdown is not an option. Disabling inline js entirely with csp is not an option. I am limited to making only these specific links not work. I do can manipulate the page html before being served, but these links parse even when you replace characters with html code, so using a regex didn’t pan out, one can replace any character for a html code and it would still work.

Source: Ask Javascript Questions

LEAVE A COMMENT