[object Object]

← back to Carnegie Reprice

carnegie-mfr-gate: broaden bodyHtmlValid entity strip (Cody TK-10820)

83498d8e4493316b5cc01222addd57ff9d7a9c77 · 2026-08-24 19:14:02 -0700 · Steve Abrams

Files touched

Diff

commit 83498d8e4493316b5cc01222addd57ff9d7a9c77
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 24 19:14:02 2026 -0700

    carnegie-mfr-gate: broaden bodyHtmlValid entity strip (Cody TK-10820)
---
 carnegie-mfr-gate.mjs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/carnegie-mfr-gate.mjs b/carnegie-mfr-gate.mjs
index 881b27c..ffe455e 100644
--- a/carnegie-mfr-gate.mjs
+++ b/carnegie-mfr-gate.mjs
@@ -50,7 +50,11 @@ export const NEEDS_DESC_TAG = 'Needs-Description';
  */
 export function bodyHtmlValid(body) {
   if (body === null || body === undefined) return false;
-  const text = String(body).replace(/<[^>]*>/g, '').replace(/&nbsp;/gi, ' ').trim();
+  const text = String(body)
+    .replace(/<[^>]*>/g, '')                 // strip tags
+    .replace(/&(nbsp|thinsp|ensp|emsp|zwnj|zwj|#x?0*(a0|160|8203);?|#160|#8203);/gi, ' ') // whitespace-like entities
+    .replace(/&[a-z]+;|&#x?[0-9a-f]+;/gi, '') // any remaining entity → drop (mdash/amp/etc. add no real words)
+    .trim();
   return text.length > 0;
 }
 

← 015d3c8 carnegie-mfr-gate: add bodyHtmlValid + wire into assertActiv  ·  back to Carnegie Reprice  ·  TK-10820: gate rebuild-line + build-one-proof born-active on 618df8b →