Skip to main content

HTML processing helpers for mobile sites

Project description

Introduction

mobile.htmlprocessing is a Python package providing utilities to sanitize arbitrary HTML content for outputting it to mobile devices.

Features

  • Rewrite <img> tags so that images are resized for mobile viewing

  • Make arbitraty input HTML to valid XHTML to more compatible with mobile phones

  • Enforce empty ALT text on images missing ALT attribute

  • Protect against Cross-Site Scripting Attacks (XSS) and other nastiness, as provided by lxml.html.clean. Both trusted HTML and non-trusted HTML processing modes are supported.

  • Unicode compliant - eats funky characters

This is a framework library which is designed to work with any web server or Python based CMS system. It allow rewrites HTML. You need to subclass and specialize provided base classes to match with your CMS paradigms. For examples, see Go Mobile for Plone CMS add-on product.

Requirements

Usage

Please see example code in unit tests.

Unit tests

Put mobile.htmlprocessing to your PYTHONPATH.

Run unit tests normally like:

python tests/test_image.py

See also

Source code

Source code is available via Google Code.

Beta software

This software is still in much development and aimed for advanced Python developers only.

Author

mFabrik Research Oy - Python and Plone professionals for hire.

Changelog

0.1

  • Initial release

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

mobile.htmlprocessing-0.1.tar.gz (5.8 kB view details)

Uploaded Source

File details

Details for the file mobile.htmlprocessing-0.1.tar.gz.

File metadata

File hashes

Hashes for mobile.htmlprocessing-0.1.tar.gz
Algorithm Hash digest
SHA256 003d92abe525c340f335b4f754016be0ea1995639ce5213626436e2c50b29c72
MD5 b371f0d0c6f9c938e647e1a27fc4fc7f
BLAKE2b-256 1cc406b7648a366a89b0c4c35e9222160ce65b7e8461149e327581f4be265740

See more details on using hashes here.

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