Skip to content

Tool for escaping script tags using backslashes (no regex).

License

Notifications You must be signed in to change notification settings

Rairye/st-no-love

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

st-no-love

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

Standard JS Version

Installation

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.

Code Sample

<script src = "st-no-love.js"> </script>
var source = "<script>Hey, how are you doing?<\/script>";
var result = escapeScriptTags(source);
console.log(result);

Module Version

Installation

Install using npm:

npm i st-no-love

Code Sample

import escapeScriptTags from "st-no-love";

var source = "<script>Hey, how are you doing?<\/script>";
var result = escapeScriptTags(source);
console.log(result);

Other Packages

If you would like to filter out or create a whitelist for punctuation characters, please see https://github.com/Rairye/js-mnl-punct-norm