-
-
16 Jun 2019 15:29:47 UTC
- Distribution: HTML-Lint-Pluggable
- Module version: 0.10
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (553 / 0 / 0)
- Kwalitee
Bus factor: 1- 92.06% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (21.29KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- VERSION
- SYNOPSIS
- DESCRIPTION
- WHY CREATED THIS MODULE?
- INTERFACE
- DEPENDENCIES
- BUGS
- SEE ALSO
- AUTHOR
- LICENSE AND COPYRIGHT
NAME
HTML::Lint::Pluggable - plugin system for HTML::Lint
VERSION
This document describes HTML::Lint::Pluggable version 0.10.
SYNOPSIS
use HTML::Lint::Pluggable; my $lint = HTML::Lint::Pluggable->new; $lint->only_types( HTML::Lint::Error::STRUCTURE ); $lint->load_plugins(qw/HTML5/); while ( my $line = <HTML> ) { $lint->parse( $line ); } $lint->eof; # or $lint->parse_file( $filename ); my $error_count = $lint->errors; foreach my $error ( $lint->errors ) { print $error->as_string, "\n"; }
DESCRIPTION
HTML::Lint::Pluggable adds plugin system for HTML::Lint.
WHY CREATED THIS MODULE?
HTML::Lint is useful. But, HTML::Lint can interpret *only* for rules of HTML4. and, HTML::Lint gives an error of "Character char should be written as entity" for such as for multi-byte characters. However, you are often no problem if they are properly encoded.
These problems can be solved easily to facilitate the various hooks for HTML::Lint.
INTERFACE
Methods
$lint->load_plugin($module_name[, \%config])
This method loads plugin for the instance.
$module_name: package name of the plugin. You can write it as two form like DBIx::Class:
$lint->load_plugin("HTML5"); # => loads HTML::Lint::Pluggable::HTML5
If you want to load a plugin in your own name space, use '+' character before package name like following:
$lint->load_plugin("+MyApp::Plugin::XHTML"); # => loads MyApp::Plugin::XHTML
$lint->load_plugins($module_name[, \%config ], ...)
Load multiple plugins at one time.
$lint->load_plugins( qw/HTML5/, WhiteList => +{ rule => +{ 'attr-unknown' => sub { my $param = shift; if ($param->{tag} =~ /input|textarea/ && $param->{attr} eq 'istyle') { return 1; } else { return 0; } }, } } ); # => loads HTML::Lint::Pluggable::HTML5, HTML::Lint::Pluggable::WhiteList
this code is same as:
$lint->load_plugin('HTML5'); # => loads HTML::Lint::Pluggable::HTML5 $lint->load_plugin(WhiteList => +{ rule => +{ 'attr-unknown' => sub { my $param = shift; if ($param->{tag} =~ /input|textarea/ && $param->{attr} eq 'istyle') { return 1; } else { return 0; } }, } }); # => loads HTML::Lint::Pluggable::WhiteList
DEPENDENCIES
Perl 5.8.1 or later.
BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.
SEE ALSO
AUTHOR
Kenta Sato <karupa@cpan.org>
LICENSE AND COPYRIGHT
Copyright (c) 2012, Kenta Sato. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install HTML::Lint::Pluggable, copy and paste the appropriate command in to your terminal.
cpanm HTML::Lint::Pluggable
perl -MCPAN -e shell install HTML::Lint::Pluggable
For more information on module installation, please visit the detailed CPAN module installation guide.