From eff4900fa8bf3e81a91c860006f287eab9a7cfaa Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Thu, 17 Sep 2026 05:14:47 +0000 Subject: [PATCH] test(issue342): widen renderMd body window so autolink assertion survives added lines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The structural test_autolink_regex_in_rendermd slices renderMd's body with a hardcoded 15000-char window. This PR's
-in-table protection adds ~315 chars near the top of renderMd, pushing the autolink pattern from offset 14785 (master) to 15100 — just past the window. The autolink regex is unchanged (12 occurrences remain in ui.js); the test window was simply too tight. Widen to 30000. Co-authored-by: JayaMegelar --- tests/test_issue342.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_issue342.py b/tests/test_issue342.py index 1f3cebf9..6ccae250 100644 --- a/tests/test_issue342.py +++ b/tests/test_issue342.py @@ -30,8 +30,11 @@ def test_autolink_regex_in_rendermd(): # Locate the renderMd function body rendermd_start = content.find('function renderMd(raw){') assert rendermd_start != -1, "renderMd function not found in ui.js" - # Find the closing brace after renderMd (look for the autolink pattern within it) - rendermd_body = content[rendermd_start:rendermd_start + 15000] + # Find the closing brace after renderMd (look for the autolink pattern within it). + # Window sized generously: renderMd has grown over time and the autolink pass + # sits well past the first 15k chars now — use a 30k window so a few added lines + # near the top of renderMd don't push the pattern out of a too-tight slice. + rendermd_body = content[rendermd_start:rendermd_start + 30000] assert 'https?:\\/\\/' in rendermd_body, ( "Autolink regex (https?:\\/\\/) not found inside renderMd() body." )