{"id":24983639,"url":"https://github.com/posthtml/posthtml-w3c","last_synced_at":"2025-04-11T20:51:19.832Z","repository":{"id":52435509,"uuid":"52548057","full_name":"posthtml/posthtml-w3c","owner":"posthtml","description":"W3C HTML Validation for PostHTML","archived":false,"fork":false,"pushed_at":"2023-01-24T00:02:01.000Z","size":48,"stargazers_count":15,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-29T21:06:08.327Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posthtml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-25T18:40:04.000Z","updated_at":"2024-03-02T05:37:10.000Z","dependencies_parsed_at":"2023-01-24T02:00:59.694Z","dependency_job_id":null,"html_url":"https://github.com/posthtml/posthtml-w3c","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-w3c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-w3c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-w3c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posthtml%2Fposthtml-w3c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posthtml","download_url":"https://codeload.github.com/posthtml/posthtml-w3c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246404023,"owners_count":20771549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-04T09:19:56.767Z","updated_at":"2025-04-11T20:51:19.809Z","avatar_url":"https://github.com/posthtml.png","language":"JavaScript","readme":"# W3C HTML Validation for PostHTML\n\nChecks if HTML is valid to W3C standards using the [W3C Validation Service](https://validator.w3.org/)\n\n## Install\n\n```bash\n(sudo) npm i -D posthtml-w3c\n```\n\n## Usage\nFor general usage and build process integration see [PostHTML Docs](https://github.com/posthtml/posthtml#usage)\n\n### Options\n\nYou can modify the behavior by passing an options object to the method:\n\n```js\nvar options = {\n  filter: [\n    'An “img” element must have an “alt” attribute, except under certain conditions.',\n  ],\n  hideEmpty: true\n}\n\nvar validate = require('posthtml-w3c')(options)\n```\n\n* `filter` - an array of strings to filter the messages. If you want to silence some warnings or errors, you can add a substring of the message to this collection. Any messages that contain a string from the `filter` array will be ignored.\n* `hideEmpty` - if `true` and no messages are found, nothing will be printed. If `false` or skipped and no messages are found, the header and summary will be printed. This option is backward-compatible.\n\n### Example using Node API\n\n```js\nconst fs = require('fs')\n\nvar posthtml = require('posthtml')\n\nvar validate = require('posthtml-w3c')()\n\nvar html = fs.readFileSync('./index.html', 'utf8')\n\nposthtml([ validate ])\n  .process(html)\n  .then(result =\u003e console.log(result.html))\n```\n#### Output\n```bash\nPostHTML W3C Validation\n-----------------------\n\n⚠ info [14:5]\nConsider using the “h1” element as a top-level heading only\n(all “h1” elements are treated as top-level headings by many\nscreen readers and other tools).\n\n⚠ info [19:5]\nConsider using the “h1” element as a top-level heading only\n(all “h1” elements are treated as top-level headings by many\nscreen readers and other tools).\n\n⚠ info [18:5]\nConsider using the “h1” element as a top-level heading only\n(all “h1” elements are treated as top-level headings by many\nscreen readers and other tools).\n\n⚠  3 Errors\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-w3c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthtml%2Fposthtml-w3c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthtml%2Fposthtml-w3c/lists"}