Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.205.630 Times

Bleach for Linux 1.0.4

Company: James Socol
Date Added: November 10, 2013  |  Visits: 563

Bleach for Linux

Report Broken Link
Printer Friendly Version


Product Homepage
Download (43 downloads)



Bleach is an HTML sanitizing library designed to strip disallowed tags and attributes based on a whitelist, and can additionally autolinkify URLs in text with an extra filter layer that Django's urlize filter doesn't have.<br /><br />Basic Use<br /><br />The simplest way to use Bleach:<br /><br />>>> from bleach import Bleach<br /><br />>>> bl = Bleach()<br /><br />>>> bl.clean('an evil() example')<br />'an evil() example'<br /><br /># to linkify URLs and email addresses, use<br />>>> bl.linkify('a http://example.com url')<br />'a http://example.com url'<br /><br />clean() also fixes up some common errors:<br /><br />>>> from bleach import Bleach<br /><br />>>> bl = Bleach()<br /><br />>>> bl.clean('unbalanced tag')<br />'unbalanced tag'<br /><br />Advanced Use<br /><br />Bleach is relatively configurable.<br />Clean - Advanced<br /><br />clean() takes up to two optional arguments, tags and attributes, which are instructions on what tags and attributes to allow, respectively.<br /><br />tags is a list of whitelisted tags:<br /><br />>>> from bleach import Bleach<br /><br />>>> bl = Bleach()<br /><br />>>> TAGS = ['b', 'em', 'i', 'strong']<br /><br />>>> bl.clean('not allowed', tags=TAGS)<br />'not allowed'<br /><br />attributes is either a list or, more powerfully, a dict of allowed attributes. If a list is used, it is applied to all allowed tags, but if a dict is use, the keys are tag names, and the values are lists of attributes allowed for that tag.<br /><br />For example:<br /><br />>>> from bleach import Bleach<br /><br />>>> bl = Bleach()<br /><br />>>> ATTRS = {'a': ['href']}<br /><br />>>> bl.clean('link', attributes=ATTRS)<br />'link'<br /><br />Linkify - Advanced<br /><br />If you pass nofollow=False to linkify(), links will not be created with rel="nofollow". By default, nofollow is True. If nofollow is True, then links found in the text will have their rel attributes set to nofollow as well, otherwise the attribute will not be modified.<br /><br />Configuring linkify() is somewhat more complicated. linkify() passes data through different filters before returning the string. By default, these filters do nothing, but if you subclass Bleach, you can override them.<br /><br />All the filters take and return a single string.<br />filter_url<br /><br />filter_url(self, url) is applied to URLs before they are put into the href attribute of the link. If you need these links to go through a redirect or outbound script, filter_url() is the function to override.<br /><br />For example:<br /><br />import urllib<br /><br />from bleach import Bleach<br /><br />class MyBleach(Bleach):<br /> def filter_url(self, url):<br /> return 'http://example.com/bounce?u=%s' % urllib.quote(url)<br /><br />Now, use MyBleach instead of Bleach and linkify() will route urls through your bouncer.<br />filter_text<br /><br />This filter is applied to the link text of linkified URLs.

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Allowed Applied Attribute Attributes Bleach Bleachgtgtgt Default Filter Filters Import Linkify Links Nofollow Return
Users rating: 0/10

License: Freeware Size: 10.24 KB
USER REVIEWS
More Reviews or Write Review


BLEACH FOR LINUX RELATED
Modules  -  Default Filter 1.0
This is useful for sites that set the global default to a less rich format to prevent anonymous users from using (for example) full HTML.Installation - Unpack in your modules folder (usually /sites/all/modules/) and enable under Administer > Site...
 
Modules  -  User Default Filter 6.x-1.1
The user's default choice is set on forms that provide selectable Input Format.InstallationUnpack in your modules folder (usually '/sites/all/modules/')Enable under Administer > Site Building > Modules.
10 KB  
Modules  -  Views Filtergroup 6.x-1.x-de
Allows grouping of filters so that only one of a set of filters is active at a time. The user can select which filter he or she wants to modify and the view is then only filtered by the selected field of the filter group.To use this module, enable...
10 KB  
Network & Internet  -  mod_proxy_html 2.5.1
mod_proxy_html is an output filter to rewrite HTML links in a proxy situation, to ensure that links work for users outside the proxy. mod_proxy_html serves the same purpose as Apaches ProxyPassReverse directive does for HTTP headers, and is an...
35.84 KB  
Networking  -  Import Blogroll With Categories 1.0
If you have ever been annoyed by the default blogroll (links, bookmarks) import functionality of WordPress forcing you to select one category to insert all links into, this plugin is for you.If you have an OPML feed that is categorized (like the...
10 KB  
Network & Internet  -  paralleltools 0.0.2
Parallel tools (named in manner to itertools & functools) is a set of commonly used list traversal functions, which is working in parallel (fault-tolerant) in synchronous or asynchronous manner. Implementation is based on python...
10.24 KB  
Modules  -  Noindex External Links 6.x-1.2
Module let's you take full control of external links indexing. Pages could also pass HTML-validation.Note: Search Engines still see all this links. If you want to hide links you should use javascript for it.Features * Two methods of indexing...
10 KB  
Libraries  -  SyslogScan::Daemon::SpamDetector::Filter 0.55
SyslogScan::Daemon::SpamDetector::Filter contains filter reports. SYNOPSIS plugin SyslogScan::Daemon::SpamDetector as sd_ sd_plugin SyslogScan::Daemon::SpamDetector::Filter status spam match SpamAssassin field relayname acceptfirst 1 accept...
18.43 KB  
Programming  -  MooseX::Getopt 0.20
MooseX::Getopt is a role which provides an alternate constructor for creating objects using parameters passed in from the command line. This module attempts to DWIM as much as possible with the command line params by introspecting your...
30.72 KB  
Development Tools  -  htmLawed for Scripts 1.1.8.1
The customizable HTML filter can balance tags, ensure proper nestings, neutralize XSS, beautify code like Tidy, restrict HTML, implement anti-spam measures, etc.Here are some key features of "htmLawed":dlTE Makes HTML code in text more secure and...
102.4 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB