diff --git a/cli/engine/engines/static-html/detect-html.mjs b/cli/engine/engines/static-html/detect-html.mjs index 482ba0cc3..e08589440 100644 --- a/cli/engine/engines/static-html/detect-html.mjs +++ b/cli/engine/engines/static-html/detect-html.mjs @@ -138,10 +138,21 @@ async function detectHtml(filePath, options = {}) { domutils, }; }); - } catch { - return detectText(html, filePath, options); + } catch (err) { + if (!globalThis.__impeccableStaticHtmlWarned) { + globalThis.__impeccableStaticHtmlWarned = true; + + process.stderr.write( + 'impeccable detect: DEGRADED - HTML parser modules unavailable ' + + '(htmlparser2, css-select, css-tree, domutils).\n' + + 'Falling back to regex matching. Custom properties, selector matching and computed ' + + 'contrast are NOT evaluated; findings are an undercount, not a clean bill of health.\n' +); } + return detectText(html, filePath, options); +} + const resolvedPath = path.resolve(filePath); const fileDir = path.dirname(resolvedPath); const root = profileStep(profile, {