Commit fd3244d
fix: filter phantom LAMPIRAN child BABs by applying hasDescendantPasal to all structural nodes
Remove the unconditional short-circuit that passed any structural node with
a non-null parent_id through the babNodes filter. Phantom TOC-BABs inside a
LAMPIRAN have parent_id = lampiran_db_id (non-null), so the guard was letting
them through despite having zero pasal descendants.
Applying hasDescendantPasal() to every structural node regardless of depth
fixes UU 6/2023 (Cipta Kerja): the duplicated TOC BABs parsed from the
LAMPIRAN TOC pages are now correctly filtered out while real BABs and their
Bagian/Paragraf sub-sections remain (they ARE in structuralIdsWithPasals).
Co-authored-by: Claude <noreply@anthropic.com>1 parent 35f080f commit fd3244d
1 file changed
+11
-10
lines changedLines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
346 | 347 | | |
347 | 348 | | |
348 | 349 | | |
| |||
0 commit comments