Skip to main content

validate_html

Function validate_html 

Source
pub fn validate_html(html: &str, profile: &str) -> String
Expand description

Full validation pipeline: extract -> vocab validate -> profile evaluate.

Runs extraction, Schema.org vocabulary validation, and profile evaluation in a single call. Returns a combined JSON result.

§Arguments

  • html – the HTML document to analyze
  • profile – the profile name to evaluate against ("google" or "baseline")

§Returns

JSON string containing:

{
"extraction": { "nodes": [...], "warnings": [...] },
"validation": { "diagnostics": [...], "has_errors": bool },
"profile": { "eligibility": "...", "type_results": [...], "diagnostics": [...] }
}

Or { "error": "..." } on extraction failure.