https://github.com/webdevbynight/markup-validator
Check the markup validity of HTML, CSS and SVG files using the W3C validator
https://github.com/webdevbynight/markup-validator
css css3 html html5 markup svg validator w3c xml
Last synced: 3 months ago
JSON representation
Check the markup validity of HTML, CSS and SVG files using the W3C validator
- Host: GitHub
- URL: https://github.com/webdevbynight/markup-validator
- Owner: webdevbynight
- License: mit
- Created: 2026-02-05T05:43:06.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-22T01:55:40.000Z (3 months ago)
- Last Synced: 2026-02-22T09:29:53.487Z (3 months ago)
- Language: TypeScript
- Homepage:
- Size: 99.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# markup-validator
Check the markup validity of HTML, CSS and SVG files using the W3C validator

[](https://nodejs.org/api/esm.html)
[](https://conventionalcommits.org)
[](https://biomejs.dev)
[](https://github.com/release-change/release-change)



**markup-validator** takes HTML, CSS and SVG files and returns detailed validation results.
## Installation
Install package for Node.js:
```
pnpm add --save-dev markup-validator
```
You can also install it using `npm`:
```
npm install --save-dev markup-validator
```
## Usage
```js
import { MarkupValidator } from "markup-validator";
const options = { files: ["docs/index.html"] };
const validator = new MarkupValidator(options);
const validate = await validator.validate();
```
### Options
##### files
Type: `array`
Specifies which files to be sent to validation. This option takes precedence over the other options.
##### paths
Type: `array`
Specifies which folders or files to be sent to validation. When omitted, all files are validated (skipping the `node_modules` folder), unless the `exclude` option is specified.
##### exclude
Type: `array`
Lists strings to match in paths to skip. When omitted, all files specified by `files` options if defined (all files otherwise) are validated (skipping the `node_modules` folder).
##### languages
Type: `array`
Default: `["html", "css", "svg"]`
Specifies which languages to validate. When omitted, all languages are validated.
##### dryRun
Type: `boolean`
Default: `false`
Bypasses the validation (for usage while building CI).
##### ignoreLevel
Type: `"info"`, `"warning"` or `null`
Default: `null`
Skips unwanted messages. When set to `"warning"`, both the `"info"` level and the `"warning"` level are skipped.
## Get help
- [Stack Overflow](https://stackoverflow.com/questions/tagged/markup-validator)
## Copyright & licence
© 2026 Victor Brito — Released under the [MIT licence](./LICENSE).