github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

oalders / html-restrict

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 2
    • 2
  • Source
  • Commits
  • Network (2)
  • Issues (0)
  • Downloads (1)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (1)
    • v0.05
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

HTML::Restrict - Strip away unwanted HTML tags — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Increased version number for release.  Removed explicit undef in return 
statement to satisfy Perl::Critic. 
oalders (author)
Wed Feb 03 10:21:40 -0800 2010
commit  f03605a45c7fb8128712475d7ef35274d1e47f79
tree    35cd818dc82a2cc54f15a725739c21c8246f0bd9
parent  61b02e4ef2ac3be025bb94dfc178eb215ee86c16
html-restrict /
name age
history
message
file Build.PL Loading commit data...
file Changes
file MANIFEST
file README
file ignore.txt
directory lib/
directory t/
README
HTML-Restrict

This module uses HTML::Parser to strip HTML from text in a restrictive manner.
By default all HTML is restricted.  You may alter the default behaviour by
supplying your own tag rules.

For example.

  use HTML::Restrict;

  my $hr = HTML::Restrict->new();

  # use default rules to start with (strip away all HTML)
  my $processed = $hr->process('<b>i am bold</b>');

  # $processed now equals: i am bold

Now, a less restrictive example:

  use HTML::Restrict;

  my $hr = HTML::Restrict->new();
  $hr->set_rules({
    b   => [],
    img => [qw( src alt / )]
  });

  my $html = q[<body><b>hello</b> <img src="pic.jpg" alt="me" id="test" /></body>];
  my $processed = $hr->process( $html );

  # $processed now equals: <b>hello</b> <img src="pic.jpg" alt="me" />

INSTALLATION

To install this module, run the following commands:

  perl Build.PL
  ./Build
  ./Build test
  ./Build install

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc HTML::Restrict

You can also look for information at:

    RT, CPAN's request tracker
        http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-Restrict

    AnnoCPAN, Annotated CPAN documentation
        http://annocpan.org/dist/HTML-Restrict

    CPAN Ratings
        http://cpanratings.perl.org/d/HTML-Restrict

    Search CPAN
        http://search.cpan.org/dist/HTML-Restrict/


COPYRIGHT AND LICENCE

Copyright (C) 2009 Olaf Alders

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server