HtmlValidator class

Comprehensive HTML5 quality auditor and validator.

Constructors

HtmlValidator()
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
validateDirectory(Directory dir, {bool strict = false, bool enableNuChecker = false, String? nuCheckerUrl}) → Future<DirectoryValidationReport>
Validates all .html files in dir.
validateHtml(String htmlContent, {String filePath = 'index.html', Directory? baseDir}) → HtmlDocumentValidationReport
Validates an HTML document string against HTML5 conformance and SEO quality rules.
validateHtmlWithStandards(String htmlContent, {String filePath = 'index.html', Directory? baseDir, bool enableNuChecker = false, String? nuCheckerUrl}) → Future<HtmlDocumentValidationReport>
Asynchronously validates htmlContent against both MetaMantle internal quality rules and an optional external HTML5 standards conformance validator (e.g. Nu HTML Checker / W3C v.Nu).

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

queryNuHtmlChecker(String htmlContent, {String? endpointUrl, Duration timeout = const Duration(seconds: 15)}) → Future<ExternalStandardsValidationResult>
Sends htmlContent to an external Nu HTML Checker instance (W3C v.Nu) for standards validation. Handles validator availability and network timeouts honestly without falsely reporting passed. Guarantees that the underlying HttpClient is closed cleanly.