Tool for escaping script tags using backslashes (no regex).
Note: This tool only escapes script tags. If you would like to replace less than or greater than signs with HTML entities, please see https://github.com/Rairye/convert-with-ents
Download the raw file at https://github.com/Rairye/de-script/blob/main/st-no-love.js
Or, download one of the releases on the right.
<script src = "st-no-love.js"> </script>
var source = "<script>Hey, how are you doing?<\/script>";
var result = escapeScriptTags(source);
console.log(result);
Install using npm:
npm i st-no-love
import escapeScriptTags from "st-no-love";
var source = "<script>Hey, how are you doing?<\/script>";
var result = escapeScriptTags(source);
console.log(result);
If you would like to filter out or create a whitelist for punctuation characters, please see https://github.com/Rairye/js-mnl-punct-norm