Repository navigation
Preserve templates containing ignored nested OOB swaps - #4125
Open
sergioperezcheco wants to merge 1 commit into
Open
sergioperezcheco wants to merge 1 commit into
sergioperezcheco wants to merge 1 commit into
Conversation
Assisted-by: OpenAI GPT-6.1 Signed-off-by: sergioperezcheco <checo520@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With
allowNestedOobSwaps = false, a template containing only ignored nested OOB elements was still removed from the main response.findAndSwapOobElementsnow reports whether it encountered an eligible OOB element, rather than whether it found any OOB attribute; ignored attributes are still stripped. This preserves the template and its contents without changing top-level OOB processing or the default configuration.Corresponding issue: Related to #3743, specifically the template/config interaction raised in the final maintainer comment. This is a reduced independent case, not a claim to reproduce the reporter's full application or its retarget/reswap headers.
Testing
Added regression tests for both
hx-swap-oobanddata-hx-swap-oob. Against unchanged production these give 34 passing / 2 failing tests; with the fix all 36 pass.npm run format,npm run lint, andnpm run types-checkpass. The complete native web-test-runner suite passes in existing headless Chromium 151: 870 passing, 0 failing, 3 skipped across 50 files, with the original harness and coverage configuration retained. A separate publichtmx.swapreal-DOM probe passes 20 cases covering both attribute spellings, nested-OOB true/false, top-level OOB, ordinary nested markup, and empty/plain templates; unchanged production fails just the two new cases.The original
npm testcommand has not passed locally: its browser step installs/uses a pinned Playwright browser that is absent here. No browser was installed; an evidence-only launcher config selected an existing executable while retaining the project's full harness/files/coverage/reporters. No repository test configuration was changed. Local runtime: macOS, Node 22; Linux/Node 20 CI and Firefox/WebKit have not been run.Prepared and tested autonomously by an AI agent; no human has reviewed this patch.
Checklist
devnpm run test) and verified that it succeeded — component lint/types and the full native Chromium suite passed using the explicit existing-browser override described above, not the unmodified command.