├── media ├── w3clinklogo.png ├── crawlingalgofc.png └── terminalsample.png ├── .travis.yml ├── src ├── rulesets │ ├── index.js │ ├── requiredAttr.js │ ├── requiredTags.js │ ├── obsoleteTags.js │ └── obsoleteAttr.js ├── alerts.js ├── links.js ├── w3clink.js └── htmlvalidator.js ├── test ├── testHTML-rule3.html ├── testHTML-rule4.html ├── testHTML-rule1.html ├── testHTML.html ├── testHTML-rule2.html └── index.js ├── PULL_REQUEST_TEMPLATE.md ├── bin └── w3clink.js ├── LICENSE ├── .github └── issue_template.md ├── .gitignore ├── package.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md └── README.md /media/w3clinklogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99x/w3c-link-validator/HEAD/media/w3clinklogo.png -------------------------------------------------------------------------------- /media/crawlingalgofc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99x/w3c-link-validator/HEAD/media/crawlingalgofc.png -------------------------------------------------------------------------------- /media/terminalsample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99x/w3c-link-validator/HEAD/media/terminalsample.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "8.4" 4 | after_success: 5 | - 'npm run coverage' 6 | - 'npm run coveralls' -------------------------------------------------------------------------------- /src/rulesets/index.js: -------------------------------------------------------------------------------- 1 | const requiredTags = require('./requiredTags'); 2 | const requiredAttr = require('./requiredAttr'); 3 | const obsoleteTags = require('./obsoleteTags'); 4 | const obsoleteAttr = require('./obsoleteAttr'); 5 | 6 | module.exports = { 7 | requiredTags, 8 | requiredAttr, 9 | obsoleteTags, 10 | obsoleteAttr, 11 | }; -------------------------------------------------------------------------------- /test/testHTML-rule3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/alerts.js:
--------------------------------------------------------------------------------
1 | var chalk = require('chalk');
2 |
3 |
4 | var alertWarning = function (msg) {
5 | console.log(chalk.bgRgb(170,170,0)(' WARNING ') + ' ' + msg);
6 | };
7 |
8 | var alertError = function (msg) {
9 | console.log(chalk.bgRgb(170,0,0).black(' ERROR ') + ' ' + msg);
10 | }
11 |
12 | var alertSuggestion = function (msg) {
13 | console.log(chalk.bgCyan.white(' SUGGEST ') + ' ' + msg);
14 | }
15 |
16 |
17 |
18 |
19 | module.exports.alertWarning = alertWarning;
20 | module.exports.alertError = alertError;
21 | module.exports.alertSuggestion = alertSuggestion;
--------------------------------------------------------------------------------
/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Types of changes
2 |
3 | - [ ] Bug fix (non-breaking change which fixes an issue)
4 | - [ ] New feature (non-breaking change which adds functionality)
5 | - [ ] Breaking change (fix or feature that would cause existing functionality to change)
6 | - [ ] I have read the **CONTRIBUTING** document.
7 | - [ ] My code follows the code style of this project.
8 | - [ ] My change requires a change to the documentation.
9 | - [ ] I have updated the documentation accordingly.
10 | - [ ] I have added tests to cover my changes.
11 | - [ ] All new and existing tests passed.
12 |
--------------------------------------------------------------------------------
/src/rulesets/requiredTags.js:
--------------------------------------------------------------------------------
1 | module.exports = [
2 | {
3 | tag : 'html',
4 | error : ' tag should appear directly after doctype declaration.',
5 | root : null,
6 | rootError : null
7 | },
8 | {
9 | tag : 'head',
10 | error : ' tag should have appeared.',
11 | root : 'html',
12 | rootError : ' tag should be added inside tag.'
13 | },
14 | {
15 | tag : 'title',
16 | error : '