Skip to main content

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.

  1. Ampersand (&)
  2. Less than (<)
  3. Greater than (>)
  4. Double quote (")
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

back_cleaner-0.0.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

back_cleaner-0.0.2-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page