release 1.15.8: kill SyntaxWarning box-drawing noise in mon HTML JS

This commit is contained in:
Hernâni Marques 2026-07-19 05:21:59 +02:00
parent b72a4f21cb
commit 6dd30ce4b8
No known key found for this signature in database
GPG key ID: CB5738652768F7E9
3 changed files with 12 additions and 4 deletions

View file

@ -1617,9 +1617,16 @@ STICKY_JS = """
return true;
}
var t = (el.textContent || "").replace(/\u00a0/g, " ").trim();
// box-drawing / pure chrome only (JS char class; escapes doubled for Python).
if (/^[\\s-]+$/.test(t)) return true;
return false;
// Pure box-drawing / whitespace chrome (no literal box glyphs in source
// those used to appear as "weird chars" in Python SyntaxWarning output).
if (!t.length) return true;
for (var bi = 0; bi < t.length; bi++) {
var bc = t.charCodeAt(bi);
if (bc === 32 || bc === 9 || bc === 10 || bc === 13 || bc === 0x2d) continue; // sp/tab/nl/cr/-
if (bc >= 0x2500 && bc <= 0x257f) continue; // box drawing
return false;
}
return true;
}
var keep = new Array(lines.length);
var i, j, k, n, idx;