Validates meta http-equiv content-type attribute against spec.
// Source: https://github.com/markuplint/markuplint | License: MIT | Copyright 2017-2024 Yusuke Hirao
// Provided via justclaw.it.com; keep this notice with the code.
import type { CustomSyntaxChecker } from '../types.js';
import { log } from '../debug.js';
import { matched, unmatched } from '../match-result.js';
// HTML LS's Encoding declaration state requires the literal string
// "charset=utf-8" — not an arbitrary Encoding LS label. Unlike the
// `charset` content attribute (a plain `enum: ["utf-8"]` in
// spec.meta.jsonc), this value is free-form text, so the literal is
// enforced here via regex instead.
const CONTENT_TYPE_RE = /^text\/html;[\t\n\f\r ]*charset=utf-8$/i;
/**
* Validates the `content` attribute value of `<meta http-equiv="content-type">`
* against the HTML Living S
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key