GithubHelp home page GithubHelp logo

davidanson / grunt-check-pages Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 2.0 176 KB

Grunt task that checks various aspects of a web page for correctness.

License: MIT License

JavaScript 89.23% HTML 10.77%

grunt-check-pages's People

Contributors

davidanson avatar furzeface avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grunt-check-pages's Issues

Showing a summary only?

When running jscs the output I get looks like this:

Running "jscs:src" (jscs) task
>> 3 files without code style errors.

Is there a way to get a similar summary output without actually displaying each of the links that is checked?

feature request: ability to ignore <a href="#">hash char url</a>

URLs with a hash character will always be valid and can safely be ignored, at least as an option. Someone might want to check if these occur, and if so they would be an error.

I modified checkPages like so:

function addLinks($, element, attribute, page, index) {
var pageHostname = url.parse(page).hostname;
$(element).each(function() {
var link = $(this).attr(attribute);
if (link && link !== '#') {
var resolvedLink = url.resolve(page, link);
var parsedLink = url.parse(resolvedLink);
if (((parsedLink.protocol === 'http:') || (parsedLink.protocol === 'https:')) &&
(!options.onlySameDomain || (parsedLink.hostname === pageHostname)) &&
!isLinkIgnored(resolvedLink)) {
// Add to beginning of queue (in order) so links gets processed before the next page
pendingCallbacks.splice(index, 0, testLink(page, resolvedLink));
index++;
}
}
});
return index;
}

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.