Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chai-htmlhint

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-htmlhint

Matcher for chai to validate that HTML is valid using HTMLHint

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

What is chai-htmlhint

chai-htmlhint is a wrapper of htmlhint to use with chai.

How to use it

You just have to pass the html you want to validate like this:

var myhtml = '<h1>my html</h1>';
expect(myhtml).to.be.validHtml;

The default rules are:

{
	"alt-require": true,
	"attr-lowercase": true,
	"attr-no-duplication": true,
	"attr-unsafe-chars": true,
	"attr-value-double-quotes": true,
	"doctype-first": true,
	"doctype-html5": true,
	"id-unique": true,
	"inline-script-disabled": false,
	"inline-style-disabled": false,
	"space-tab-mixed-disabled": true,
	"spec-char-escape": true,
	"src-not-empty": true,
	"style-disabled": true,
	"tag-pair": true,
	"tag-self-close": true,
	"tagname-lowercase": true,
	"title-require": true
};

If you want to override you just need a valid .htmlhintrc file in the root of your project

Keywords

FAQs

Package last updated on 15 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc