Skip to main content

html sanitiezer from djang0byte

Project description

Djang0parser

Multifunctional html sanitizer with code highlighting and django integration

Installing

In settings set VALID_TAGS and VALID_ATTRS, like:
>>> VALID_TAGS = 'a strong img cut'
>>> VALID_ATTRS = 'href src'

Add djang0parser to INSTALLED_APPS and run syncdb.

Usage

For text sanitizing use:
>>> from djang0parser.utils import parse
>>> parse(text)
or:
>>> parse(text, 'a b i img', 'src style')
For reverting changes use:
>>> from djang0parser.utils import unparse
>>> unparse(parsed_text)
For finding user mention use:
>>> from djang0parser.utils import find_mentions
>>> find_mentions(text)
For cut and full cut(fcut) use:
>>> from djang0parser.utils import cut
>>> preview, text = cut(full_text)

Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

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

Files for django-parser, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size django_parser-0.3-py2-none-any.whl (7.2 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-parser-0.3.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page