mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
fix(posting-guard): read style values like a browser and treat a collapsed, clipped box as hidden (#709)
* fix(posting-guard): read style values like a browser and treat a collapsed, clipped box as hidden The hidden-style regex ran on the raw attribute value, so "display:none" (entity-encoded colon) and "display:/**/none" (a CSS comment inside the declaration) both hid the content in a browser while the guard showed it under a clean verdict. A zero-height or zero-width box with overflow:hidden, the other common way to hide a block, was not a hidden style at all. Entity-decode and comment-strip the value before matching, and count a collapsed box as hidden only when both halves are present: overflow: hidden alone is on most cards and height:0 alone is a spacer. Three new Bypasses cases (seven subtests fail on master) plus a calibration case pinning that either half alone stays visible. * changelog: place the #709 entry under [Unreleased] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
3 files changed
+59
-3
No files matched your search
@@ -415,6 +415,17 @@ per-file diff commands.
|
||||
lines, six of which fail on master, and ten prose lines with the same words that must stay
|
||||
clean.
|
||||
|
||||
- **`posting_guard.py` reads a style attribute the way a browser does and treats a collapsed,
|
||||
clipped box as hidden** (#709, `tools/posting_guard.py`, `tests/test_posting_guard.py`) - the hidden-style
|
||||
regex ran on the raw attribute value, so `display:none` (entity-encoded colon) and
|
||||
`display:/**/none` (a CSS comment inside the declaration) both hid the content in a browser
|
||||
while the guard showed it under a clean verdict; and a zero-height or zero-width box with
|
||||
`overflow:hidden`, the other common way to hide a block, was not a hidden style at all.
|
||||
The value is now entity-decoded and comment-stripped before matching, and a collapsed box
|
||||
counts as hidden only when both halves are present, because `overflow:hidden` alone is on
|
||||
most cards and `height:0` alone is a spacer. Three new `Bypasses` cases, seven subtests
|
||||
failing on master, plus a calibration case pinning that either half alone stays visible.
|
||||
|
||||
### Security
|
||||
|
||||
- **CI no longer leaves the job token in `.git/config` or expands a PR-controlled name into a
|
||||
|
||||
Reference in new issue
Block a user