├── .github └── issue_template.md ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── bin └── w3clink.js ├── media ├── crawlingalgofc.png ├── terminalsample.png └── w3clinklogo.png ├── package.json ├── src ├── alerts.js ├── htmlvalidator.js ├── links.js ├── rulesets │ ├── index.js │ ├── obsoleteAttr.js │ ├── obsoleteTags.js │ ├── requiredAttr.js │ └── requiredTags.js └── w3clink.js └── test ├── index.js ├── testHTML-rule1.html ├── testHTML-rule2.html ├── testHTML-rule3.html ├── testHTML-rule4.html └── testHTML.html /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | - [ ] I have tried looking for similar issues and I am sure this is a new issue. 8 | 9 | 10 | ### Description 11 | [Consise description of issue] 12 | 13 | ### Steps to Reproduce 14 | 1. [Step One] 15 | 2. [Step Two] 16 | 3. [and so on...] 17 | 18 | **Expected behavior**: [What you expect to happen] 19 | 20 | **Actual behavior**: [What actually happens] 21 | 22 | **Reproduces how often**: [What percerage of the time does it reproduce?] 23 | 24 | ### Versions 25 | _Please include package version (in `package.json`), npm version (`npm -v`), node version (`node -v`), OS and any other relevant software versions_ 26 | 27 | **Package**: [0.0.0] 28 | 29 | **npm**: [0.0.0] 30 | 31 | **node**: [0.0.0] 32 | 33 | ### Additional Information 34 | [Any other infomation, configuration or data that might be necessary to reproduce this issue.] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # webstorm files 2 | .idea/ 3 | 4 | # Windows Thumbnails 5 | Thumbs.db 6 | 7 | # Logs 8 | logs 9 | *.log 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Runtime data 15 | pids 16 | *.pid 17 | *.seed 18 | *.pid.lock 19 | 20 | # Directory for instrumented libs generated by jscoverage/JSCover 21 | lib-cov 22 | 23 | # Coverage directory used by tools like istanbul 24 | coverage 25 | 26 | # nyc test coverage 27 | .nyc_output 28 | 29 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 30 | .grunt 31 | 32 | # Bower dependency directory (https://bower.io/) 33 | bower_components 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (http://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directories 42 | node_modules/ 43 | jspm_packages/ 44 | 45 | # Typescript v1 declaration files 46 | typings/ 47 | 48 | # Optional npm cache directory 49 | .npm 50 | 51 | # Optional eslint cache 52 | .eslintcache 53 | 54 | # Optional REPL history 55 | .node_repl_history 56 | 57 | # Output of 'npm pack' 58 | *.tgz 59 | 60 | # Yarn Integrity file 61 | .yarn-integrity 62 | 63 | # dotenv environment variables file 64 | .env 65 | 66 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "8.4" 4 | after_success: 5 | - 'npm run coverage' 6 | - 'npm run coveralls' -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | Using welcoming and inclusive language 12 | Being respectful of differing viewpoints and experiences 13 | Gracefully accepting constructive criticism 14 | Focusing on what is best for the community 15 | Showing empathy towards other community members 16 | Examples of unacceptable behavior by participants include: 17 | 18 | The use of sexualized language or imagery and unwelcome sexual attention or advances 19 | Trolling, insulting/derogatory comments, and personal or political attacks 20 | Public or private harassment 21 | Publishing others' private information, such as a physical or electronic address, without explicit permission 22 | Other conduct which could reasonably be considered inappropriate in a professional setting 23 | 24 | ## Our Responsibilities 25 | 26 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 27 | 28 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 29 | 30 | ## Scope 31 | 32 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 33 | 34 | ## Enforcement 35 | 36 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at **99xt@googlegroups.com**. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 37 | 38 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 39 | 40 | ## Attribution 41 | 42 | This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4). 43 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to w3c-link-validator 2 | 3 | :tada: Great to see your interested in contributing! :tada: 4 | 5 | The following guidelines are set out for contributing to w3c-link-validator, please read through carefully 6 | 7 | 8 | ## Table of Contents 9 | 10 | [Code of Conduct](#code-of-conduct) 11 | 12 | [Getting Started](#getting-started) 13 | - [How it works (crawling algorithm)](#how-it-works-crawling-algorithm) 14 | - [Development Setup](#development-setup) 15 | 16 | [Found a bug?](#found-a-bug) 17 | 18 | [Submitting an Issue](#submitting-an-issue) 19 | - [Reporting Bugs](#reporting-bugs) 20 | - [Suggesting Ehancements](#suggesting-enhancements) 21 | - [Code Contribution](#code-contribution) 22 | - [Beginner Issues](#beginner-issues) 23 | 24 | [Styleguides](#styleguides) 25 | - [Git Commit Message](#git-commit-messages) 26 | - [JavaScript Styleguide](#javascript-styleguide) 27 | - [Ruleset Styleguide](#ruleset-styleguide) 28 | 29 | [Attributions](#attributions) 30 | 31 | [License](#license) 32 | 33 | 34 | ## Code of Conduct 35 | This project and everyone participating in it is govered by our [Code of Conduct](https://github.com/99xt/w3c-link-validator/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to upload this code. Please report unacceptable behavior to [99xt@googlegroups.com](mailto:99xt@googlegroups.com). 36 | 37 | 38 | ## Getting Started 39 | 40 | > Coming soon 41 | 42 | 43 | ### How it works (crawling algorithm) 44 | ![Crawling algorithm flowchart](media/crawlingalgofc.png "Crawling algorithm flowchart") 45 | 46 | ### Development Setup 47 | Fork and clone repo 48 | 49 | ```bash 50 | $ git clone https://github.com//w3c-link-validator.git 51 | ``` 52 | 53 | Install dependencies 54 | 55 | ```bash 56 | $ npm install 57 | ``` 58 | 59 | Link to global commands 60 | 61 | ```bash 62 | $ npm link 63 | ``` 64 | 65 | Run the tests 66 | 67 | ```bash 68 | $ npm run test 69 | ``` 70 | 71 | Check the code coverage with [istanbul](https://istanbul.js.org/). HTML report will be generated to `/coverage/lcov-report` 72 | 73 | ```bash 74 | $ npm run coverage 75 | ``` 76 | 77 | 78 | ## Found a bug? 79 | **Ensure the bug has not already been reported** by searching on GitHub under [Issues](https://github.com/99xt/w3c-link-validator/issues) 80 | 81 | **Unable to find a issue addressing the problem?** [Open a new one](https://github.com/99xt/w3c-link-validator/issues/new) and follow steps below and template provided. 82 | 83 | 84 | ## Submitting an Issue 85 | 86 | > Coming Soon 87 | 88 | ### Reporting Bugs :space_invader: 89 | 90 | > Coming Soon 91 | 92 | ### Suggesting Enhancements :bulb: 93 | 94 | > Coming Soon 95 | 96 | ### Code Contribution 97 | 98 | > Coming Soon 99 | 100 | #### Beginner Issues 101 | 102 | > Coming Soon 103 | 104 | 105 | ## Attributions 106 | These contribution guidelines have been adapted from the [Atom editor contribution guidelines](https://github.com/atom/atom/blob/master/CONTRIBUTING.md). 107 | 108 | ## License 109 | MIT © [99XT](https://github.com/99xt) 110 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 99X Technology 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | Crawling algorithm flowchart 3 |
4 | 5 | [![Join the chat at https://gitter.im/w3c-link-validator/Lobby](https://badges.gitter.im/w3c-link-validator/Lobby.svg)](https://gitter.im/w3c-link-validator/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 6 | [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/99xt/w3c-link-validator/master/LICENSE) 7 | [![Build Status](https://travis-ci.org/shalithasuranga/w3c-link-validator.svg?branch=master)](https://travis-ci.org/shalithasuranga/w3c-link-validator) 8 | [![Coverage Status](https://coveralls.io/repos/github/shalithasuranga/w3c-link-validator/badge.svg?branch=master)](https://coveralls.io/github/shalithasuranga/w3c-link-validator?branch=master) 9 | 10 | Very good command line tool for W3C validation and broken link detection of your local development or production URL. 11 | Validation errors,warnings or suggestions will be reported to terminal. 12 | 13 | 14 | ## Installation 15 | 16 | 17 | Install with the terminal. 18 | 19 | ```bash 20 | $ npm install w3c-link-validator -g 21 | ``` 22 | 23 | After installation `w3clink` command will be available globally. 24 | 25 | 26 | ## Tutorial 27 | 28 | #### Get started 29 | 30 | See the command line help first. 31 | 32 | ```bash 33 | $ w3clink --help 34 | ``` 35 | 36 | 37 | ```bash 38 | 39 | Usage: w3clink [options] 40 | 41 | 42 | Options: 43 | 44 | -V, --version output the version number 45 | check, --check [verbose] [onlyhtml] [suggestions] Validate links and html both 46 | -h, --help output usage information 47 | 48 | ``` 49 | 50 | #### Validation command 51 | 52 | 53 | ```bash 54 | $ w3clink check [options] 55 | ``` 56 | 57 | 58 | This command will start validation service for specific URL. URLs per each page will be tested recursively. 59 | 60 | **Options** 61 | 62 | - `verbose` will show you anything during the validation. Eg hyperlinks per page. 63 | - `onlyhtml` will block the deep url traversing. Use if you want to validate html standards only. 64 | - `suggestions` will log the suggestions also. 65 | 66 | Example 67 | 68 | ```bash 69 | $ w3clink check http://localhost/w3ctest/ suggestions 70 | ``` 71 | 72 | Sample output on Windows terminal 73 | 74 | ![Sample terminal output](media/terminalsample.png "Sample terminal output") 75 | 76 | Massive websites may log bunch of messages to your terminal. Therefore you may save your log to a file. 77 | 78 | ```bash 79 | $ w3clink check http://localhost/w3ctest/ suggestions > mylogfile.txt 80 | ``` 81 | 82 | 83 | 84 | ## Contributing 85 | [**Click here to view the full contribution guidelines**](CONTRIBUTING.md) 86 | 87 | #### Development setup 88 | 89 | Fork and clone repo 90 | 91 | ```bash 92 | $ git clone https://github.com//w3c-link-validator.git 93 | ``` 94 | 95 | Install dependencies 96 | 97 | ```bash 98 | $ npm install 99 | ``` 100 | 101 | Link to global commands 102 | 103 | ```bash 104 | $ npm link 105 | ``` 106 | 107 | Run the tests 108 | 109 | ```bash 110 | $ npm run test 111 | ``` 112 | 113 | Check the code coverage with [istanbul](https://istanbul.js.org/). HTML report will be generated to `/coverage/lcov-report` 114 | 115 | ```bash 116 | $ npm run coverage 117 | ``` 118 | 119 | 120 | 121 | 122 | #### Crawling algorithm 123 | 124 | 125 | ![Crawling algorithm flowchart](media/crawlingalgofc.png "Crawling algorithm flowchart") 126 | 127 | 128 | #### Your contribution 129 | 130 | We expect your contribution to improve this project. You may.. 131 | 132 | - Open [issues](https://guides.github.com/features/issues/) for bug reporting or new feature suggestions. 133 | - Submit [pull requests](https://help.github.com/articles/about-pull-requests/) from your fork in order to close existing issues. 134 | 135 | We encourage you to apply Github best practices for the communication and development through the repo. 136 | 137 | Happy contributing! 138 | 139 | ## Acknowledgement 140 | 141 | w3c-link-validator is initially developed for the [Hacktitude](http://opensource.99xtechnology.com/hacktitude/) open source hackathon. Special thanks goes to project mentors [@thinkholic](https://github.com/thinkholic), [@lakindu95](https://github.com/lakindu95), [@rehrumesh](https://github.com/rehrumesh) and awesome [Dotitude Family](http://dotitude.com/) from [99xt](http://99xtechnology.com/). 142 | 143 | ## License 144 | 145 | MIT © [99XT](https://github.com/99xt) 146 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /bin/w3clink.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict' 4 | 5 | var w3clink = require('../src/w3clink'); 6 | var program = require('commander'); 7 | const version = "1.0.0"; 8 | 9 | 10 | var cliApp = function (args) { 11 | 12 | program.version(version) 13 | .option('check, --check [verbose] [onlyhtml] [suggestions]', 'Validate links and html both'); 14 | 15 | program.parse(args); 16 | 17 | if (typeof program.check != 'undefined') { 18 | var url = program.check; 19 | w3clink.init({ 20 | localUrl : url, 21 | verbose : program.args.indexOf('verbose') != -1, 22 | onlyhtml : program.args.indexOf('onlyhtml') != -1, 23 | suggestions : program.args.indexOf('suggestions') != -1 24 | }); 25 | w3clink.exec(); 26 | } 27 | 28 | return true; 29 | 30 | } 31 | 32 | module.exports.cliApp = cliApp; 33 | 34 | cliApp(process.argv); 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /media/crawlingalgofc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99x/w3c-link-validator/d725b532c033a8c82edfda678ed70253641d046c/media/crawlingalgofc.png -------------------------------------------------------------------------------- /media/terminalsample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99x/w3c-link-validator/d725b532c033a8c82edfda678ed70253641d046c/media/terminalsample.png -------------------------------------------------------------------------------- /media/w3clinklogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/99x/w3c-link-validator/d725b532c033a8c82edfda678ed70253641d046c/media/w3clinklogo.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "w3c-link-validator", 3 | "version": "1.0.0", 4 | "description": "Command line tool, identifying broken links, validate basic html standards and reporting", 5 | "main": "./src/w3clink.js", 6 | "scripts": { 7 | "test": "mocha test/index.js", 8 | "coverage": "istanbul cover node_modules/mocha/bin/_mocha", 9 | "coveralls": "npm run-script coverage && coveralls < coverage/lcov.info" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/99xt/w3c-link-validator.git" 14 | }, 15 | "keywords": [ 16 | "w3c", 17 | "link", 18 | "validator" 19 | ], 20 | "author": "99xt", 21 | "license": "MIT", 22 | "bugs": { 23 | "url": "https://github.com/99xt/w3c-link-validator/issues" 24 | }, 25 | "homepage": "https://github.com/99xt/w3c-link-validator#readme", 26 | "dependencies": { 27 | "chalk": "^2.1.0", 28 | "cheerio": "^0.22.0", 29 | "commander": "^2.11.0", 30 | "figures": "^2.0.0", 31 | "request": "^2.81.0" 32 | }, 33 | "bin": { 34 | "w3clink": "./bin/w3clink.js" 35 | }, 36 | "devDependencies": { 37 | "chai": "^4.1.2", 38 | "coveralls": "^2.13.1", 39 | "istanbul": "^0.4.5", 40 | "mocha": "^3.5.3" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /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; -------------------------------------------------------------------------------- /src/htmlvalidator.js: -------------------------------------------------------------------------------- 1 | var alerts = require('./alerts'); 2 | const chalk = require('chalk'); 3 | const figures = require('figures'); 4 | const { requiredTags, requiredAttr, obsoleteTags, obsoleteAttr } = require('./rulesets'); 5 | 6 | var globalOptions = { 7 | localUrl : '', 8 | localHost : '', 9 | verbose : true, 10 | onlyhtml : false, 11 | suggestions : false 12 | }; 13 | 14 | var totalHtmlProblems = 0; 15 | var totalHtmlSuggestions = 0; 16 | 17 | var setGlobals = function (options) { 18 | globalOptions = options; 19 | }; 20 | 21 | var previousTags = {}; 22 | const TAB_LENGTH = 8; 23 | 24 | var lineAndColumn = function (html, $) { 25 | if (!previousTags[html]) previousTags[html] = 0; 26 | 27 | var occurences = ++previousTags[html]; 28 | var lines = $.html().split(html, occurences).join(html).split(/\r\n|\r|\n/); 29 | var column = lines[lines.length - 1].replace("\t", ' '.repeat(TAB_LENGTH)).length; 30 | 31 | return '[' + lines.length + ':' + column + ']'; 32 | } 33 | 34 | var validateHtml = function ($) { 35 | var totalProblems = 0; 36 | var totalSuggestions = 0; 37 | 38 | console.log(chalk.yellow(figures.pointer) + chalk.rgb(200,200,200)(' Checking HTML guidelines...\n')); 39 | 40 | /* 41 | * References 42 | * https://google.github.io/styleguide/htmlcssguide.html 43 | * https://www.w3.org/TR/html5/syntax.html#obsolete-permitted-doctype 44 | * */ 45 | 46 | /* 47 | * RULE 1 - Required tags - !DOCTYPE syntax, html, head, title and body 48 | * Reference : https://google.github.io/styleguide/htmlcssguide.html#Document_Type 49 | * 50 | * */ 51 | if($.html().search(' tag, at the very start of each document you write.'); 53 | totalProblems++; 54 | } 55 | 56 | for(var requireTagsIndex in requiredTags){ 57 | var requiredTag = requiredTags[requireTagsIndex]; 58 | var requiredTagDom = $(requiredTag.tag); 59 | if(requiredTagDom.length == 0){ 60 | alerts.alertError(requiredTag.error); 61 | totalProblems++; 62 | } 63 | else if(requiredTag.root != null){ 64 | var childNode = $(requiredTag.root + ' ' + requiredTag.tag); 65 | if(childNode.length == 0){ 66 | alerts.alertError(requiredTag.rootError); 67 | totalProblems++; 68 | } 69 | } 70 | } 71 | 72 | 73 | /* 74 | * RULE 2 - Required Attributes 75 | * Reference : https://google.github.io/styleguide/htmlcssguide.html#Multimedia_Fallback 76 | * 77 | * */ 78 | for(var requiredAttributesIndex in requiredAttr){ 79 | var requiredAttribute = requiredAttr[requiredAttributesIndex]; 80 | var requiredAttributesDom = $(requiredAttribute.tag); 81 | 82 | for(var i=0; i and is completely obsolete, and must not be used by authors.', 6 | solution : 'Use a HTTP Content-Type header on the linked resource instead.' 7 | }, 8 | { 9 | tags : 'a', 10 | attribute : 'coords', 11 | error : 'coords attribute on is completely obsolete, and must not be used by authors.', 12 | solution : 'Use instead of for image maps.' 13 | }, 14 | { 15 | tags : 'a', 16 | attribute : 'shape', 17 | error : 'shape attribute on is completely obsolete, and must not be used by authors.', 18 | solution : 'Use instead of for image maps.' 19 | }, 20 | { 21 | tags : 'a,link', 22 | attribute : 'methods', 23 | error : 'methods attribute on and is completely obsolete, and must not be used by authors.', 24 | solution : 'Use the HTTP OPTIONS feature instead.' 25 | }, 26 | { 27 | tags : 'a,embed,img,option', 28 | attribute : 'name', 29 | error : 'name attribute on , , and is completely obsolete, and must not be used by authors.', 36 | solution : 'Specify the preferred persistent identifier using the href attribute instead.' 37 | }, 38 | { 39 | tags : 'form', 40 | attribute : 'accept', 41 | error : 'accept attribute on
is completely obsolete, and must not be used by authors.', 42 | solution : 'Use the accept attribute directly on the instead.' 43 | }, 44 | { 45 | tags : 'area', 46 | attribute : 'nohref', 47 | error : 'nohref attribute on is completely obsolete, and must not be used by authors.', 48 | solution : 'Omitting the href attribute is sufficient as is not necessary (Omit it altogether).' 49 | }, 50 | { 51 | tags : 'head', 52 | attribute : 'profile', 53 | error : 'profile attribute on is completely obsolete, and must not be used by authors.', 54 | solution : 'When used for declaring which meta terms are used in the document it is not necessary (omit it altogether), and register the names.\n' + 55 | 'When used for triggering specific user agent behaviors use (element) instead.' 56 | }, 57 | { 58 | tags : 'h1,h2,h3,h4,h5,h6', 59 | attribute : 'align', 60 | error : 'align attribute in

...

is completely obsolete, and must not be used by authors.', 61 | solution : 'Use CSS instead.' 62 | }, 63 | { 64 | tags : 'img', 65 | attribute : 'border', 66 | error : 'border attribute in is completely obsolete, and will trigger warnings in conformance checkers.', 67 | solution : 'Use CSS instead .' 68 | }, 69 | ]; 70 | -------------------------------------------------------------------------------- /src/rulesets/obsoleteTags.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | tag : 'applet', 4 | error : ' is completely obsolete, and must not be used by authors.', 5 | solution : 'Use or instead.' 6 | }, 7 | { 8 | tag : 'acronym', 9 | error : ' is completely obsolete, and must not be used by authors.', 10 | solution : 'Use instead.' 11 | }, 12 | { 13 | tag : 'bgsound', 14 | error : ' is completely obsolete, and must not be used by authors.', 15 | solution : 'Use