Server-side Python tool for escaping script tags and converting characters into HTML entity equivalents (no regex)
Project description
back-cleaner
Server-side Python tool for escaping script tags and converting characters into HTML entity equivalents (no regex).
def escape_script_tags(input_str)
This function escapes script tags with backslashes.
Sample
from back_cleaner.cleaner import escape_script_tags
source = "<script>Hey, how are you doing?</script>" result = escape_script_tags(source) print(result)
def replace_with_ents(input_str)
This function converts the following characters into the HTML entity equivalents.
- Ampersand (&)
- Less than (<)
- Greater than (>)
- Double quote (")
- Single quote (')
Sample
from back_cleaner.cleaner import replace_with_ents
source = "<script>Hey, how are you doing?</script>" result = replace_with_ents(source) print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for back_cleaner-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 692ff3b51f9e27535e87eaacb792c3cdf21603ff725e707886eaa6db3dae71ff |
|
MD5 | 53e68df42bb8cd95918784b9eb1318fa |
|
BLAKE2b-256 | abb291f863d03bdf82773fd1ef68e209daf297f0e77e3df72c7e2a711a4fd0d1 |