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

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

Serving Software Downloads in 976 Categories, Downloaded 29.546.728 Times

Bleach for Linux 1.0.4

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

Bleach for Linux

Report Broken Link
Printer Friendly Version


Product Homepage
Download (18 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  -  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  
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  
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  
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  
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  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
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  
Linux Software  -  SLAX 6.0+
Slax is a modern, portable, small and fast Linux operating system with a modular approach and outstanding design. Despite its small size, Slax provides a wide collection of pre-installed software for daily use, including a well organized graphical...
190 KB  
Linux Software  -  GTK+ 2.5
GTK+, which stands for the GIMP Toolkit, is a library for creating graphical user interfaces for the X Window System. It is designed to be small, efficient, and flexible. GTK+ is written in C with a very object-oriented approach. Language bindings...
60 MB  
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB