From dba3ee1815e29959062947a39f1db27b4b5ac586 Mon Sep 17 00:00:00 2001 From: ergosteur Date: Fri, 21 Aug 2026 17:15:11 -0400 Subject: [PATCH] Defense-in-depth: neutralize raw HTML in md_to_html.py itself The previous fix escaped AD data at generation time in both scripts, but the converter still blindly trusted its input -- a report from before that fix, from a hand edit, or from a third-party tool would still render live HTML unmodified. Normalize the whole Markdown source before parsing: unescape any existing entities, then re-escape &, <, > uniformly. The round trip keeps already-escaped (freshly generated) reports single-escaped instead of doubling up, while raw/legacy unescaped HTML gets neutralized for the first time. Neither script intentionally emits raw HTML, so this is safe across all normal report content. Verified: a freshly-escaped report stays single-escaped (AT&T reads as AT&T, not AT&amp;T), a hand-written report with a live