Skip to content
This repository has been archived by the owner on Apr 14, 2019. It is now read-only.

Add support for HTML::Lint::Pluggable #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swelljoe
Copy link

Test::HTML::Lint currently only supports a $lint object reference of type HTML::Lint, which prevents use of HTML::Lint::Pluggable modules in tests. I needed HTML5 support, so I did some digging, and found why it didn't work. This change allows tests using the HTML4 validator to continue to work, as before, but now makes it possible to add new validators via the pluggable interface.

Using it looks exactly the same, except for setting up the $lint object:

    use HTML::Lint::Pluggable;
    my $lint = new HTML::Lint::Pluggable;
    $lint->load_plugins(qw/HTML5/);

    html_ok( $lint, $content, "HTML validation");

Test::HTML::Lint currently only supports a $lint object reference of type HTML::Lint, which prevents use of HTML::Lint::Pluggable modules in tests. I needed HTML5 support, so I did some digging, and found why it didn't work. This change allows tests using the HTML4 validator to continue to work, as before, but now makes it possible to add new validators via the pluggable interface.

Using it looks exactly the same, except for setting up the $lint object:

        use HTML::Lint::Pluggable;
        my $lint = new HTML::Lint::Pluggable;
        $lint->load_plugins(qw/HTML5/);

        html_ok( $lint, $content, "HTML validation");
@petdance
Copy link
Owner

I've never seen HTML::Lint::Pluggable before. I'll have to take a look at it.

@petdance
Copy link
Owner

petdance commented Dec 7, 2016

Is this still something you'd like to see supported?

@swelljoe
Copy link
Author

swelljoe commented Dec 7, 2016

Sure. As far as I recall, it just needs this patch merged to make it work. I believe it was backward compatible (tests worked). It's been a while since I poked at it. So, I think it is easy (merge the patch), and I think it is safe (it won't break existing use cases). I used the patched version for a while without incident, and will probably come back to it eventually.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants