Files
pbakaus_impeccable/tests/fixtures/antipatterns/em-dash-entities.html
T
Paul BakausandClaude Fable 5 7dcca2bb36 Count em-dash HTML entities in em-dash-overuse
The em-dash-overuse text analyzer ran stripHtmlToText over raw markup,
which drops tags but leaves character entities intact. A model that wrote
—, —, or — rendered a real em-dash the counter never
saw, so 12 entity-escaped dashes on a live page slipped through.

Decode the em-dash entities (named, zero-padded decimal, upper/lower hex)
to the literal glyph before counting. En-dash entities stay untouched: the
rule counts em-dashes, and the literal en-dash was never counted either.

The gap lived only in the regex / static-HTML path (detectText and
detect-html's runTextContentAnalyzers, both over raw HTML). The browser
adapter never ran this analyzer, so build:browser and build:extension
produce no diff.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-22 00:27:59 -07:00

18 lines
410 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Em-dash entity overuse</title>
</head>
<body>
<main>
<h1>A page whose em-dashes hide inside HTML entities</h1>
<p>
The product is fast &mdash; it is also cheap &mdash; and it is honest
&mdash; which matters &mdash; more than speed &mdash; or price
&mdash; in the long run.
</p>
</main>
</body>
</html>