release 1.15.8: kill SyntaxWarning box-drawing noise in mon HTML JS
This commit is contained in:
parent
5f57826030
commit
7a5651f25b
3 changed files with 12 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue