Giter VIP home page Giter VIP logo

Comments (7)

mattdell avatar mattdell commented on May 18, 2024 1

I think a good enhancement would be to have the ignore rules in sync with this list: https://github.com/nature/pa11y/wiki/HTML-CodeSniffer-Rules

That's where I got the rule that I wanted to ignore and then copy/pasted it from there. I hadn't thought of copy/pasting straight from terminal.

from pa11y.

whymarrh avatar whymarrh commented on May 18, 2024

Hey Matt, can you share the url and standard you are running the test with (I'm assuming from the error that it's WCAG2AA)? Note that if you are trying to ignore WCAG2AA.-prefixed errors, that you need to be testing against WCAG2AA.

from pa11y.

whymarrh avatar whymarrh commented on May 18, 2024

Just as an example, the following works for me, and running it with and without the ignore produce the expected results:

var pa11y = require('pa11y');
pa11y.sniff({
    url: 'https://www.reddit.com/r/thebutton/',
    standard: 'WCAG2A',
    useragent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.104 Safari/537.36',
    config: {
        ignore: [
            'WCAG2A.Principle2.Guideline2_4.2_4_4.H77,H78,H79,H80,H81'
        ]
    },
}, function(err, results) {
    if (err) {
        console.error(err);
        process.exit(1);
    }
    console.log(results);
});

from pa11y.

mattdell avatar mattdell commented on May 18, 2024

Hey, thanks for the quick response!

I'm running it against localhost so I can't share the URL. But, it seems changing the ignore rule from WCAG2AA.Principle1.Guideline1_4.1_4_3.G18 to WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail seems to have worked.

I would have thought it would work without the .Fail.

from pa11y.

whymarrh avatar whymarrh commented on May 18, 2024

Yeah, it requires the rule verbatim as it appears in the results. Maybe it should work w/o the .Fail (and possibly without the standard prefix)? That would be a good enhancement.

from pa11y.

whymarrh avatar whymarrh commented on May 18, 2024

Well it did say that they "can be used in a config file to ignore certain rules", so...yeah. I've updated that page to try and clarify the workflow -- some of those rules are dependent on e.g. [NodeName] so I'm not sure if it could be in sync.

from pa11y.

mattdell avatar mattdell commented on May 18, 2024

Cool, thanks for looking into that. Hopefully it helps clear it up for anyone else!

from pa11y.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.