Commit fbd413f
fix: address review 4139627117 — lang attribute boundary + resilient strip pass
- getLangAttributeValue: require `lang` to be preceded by `<` (tag start)
or whitespace, so attributes like `data-lang` / `xml:lang` are no
longer mistakenly treated as `lang`.
- stripLangTaggedBlocks: when parseTagAt returns null (stray `<` in
text / malformed markup), advance one character and continue
instead of breaking, so later lang-tagged blocks are still stripped.
- Added regression tests for both cases. 41/41 leakage tests pass.
Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/5c8ca773-8b4f-480a-9557-3db1ca666cc1
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>1 parent fed497f commit fbd413f
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
| |||
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
334 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
335 | 343 | | |
336 | 344 | | |
337 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
351 | 371 | | |
352 | 372 | | |
0 commit comments