test(issue342): widen renderMd body window so autolink assertion survives added lines

The structural test_autolink_regex_in_rendermd slices renderMd's body with a
hardcoded 15000-char window. This PR's <br>-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 <JayaMegelar@users.noreply.github.com>
This commit is contained in:
nesquena-hermesandJayaMegelar committed 2026-09-17 05:14:47 +00:00
1 parent 38ab9f51fa
commit eff4900fa8
1 file changed
+5 -2
+5 -2
View File
@@ -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."
)