Repository navigation
fix(content): keep a collapsed FAQ's answers when URL import finds it next to the post body - #1405
Merged
Merged
Conversation
… next to the post body URL import removes what a page hides outside the text area, which is right for menus and banners. A common layout puts a collapsed FAQ after the post body, still inside the page's main block. Its questions came through, and its hidden answers didn't. A hidden block right after a heading (h2 to h6), the accordion's shape, now waits until the root is known. It is kept when it sits inside the root, and removed otherwise. Other hidden blocks outside the text are still removed, and blocks hidden until found work as before. Closes #1381
This was referenced Oct 23, 2026
Merged
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.
Summary
URL import (Content Editor › New content › Optimize › Page URL) dropped the answers of a collapsed FAQ that sits next to the post body rather than inside it.
Why it happened.
server/src/lib/page-content.jspicks the post body as the text area and removes hidden blocks outside it. In the common layout,<main>holds the post body and then an FAQ section, so the FAQ's questions came through and its hidden answers didn't.The fix. A hidden block right after a heading (
h2–h6) is an accordion's answer, so it no longer goes with the other hidden blocks.hidden="until-found"work as before.Tests. A new test in
page-content.test.jscovers a post followed by an FAQ section:hiddenanddisplay:none) come through;The test fails without the change.
Related issue
Closes #1381
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Server:
npm run format && npm run lint && npm test(2,128 tests) pass.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): no web changeyarn typecheckpasses (run fromweb/): no web changeyarn format:checkpasses (run fromweb/): no web change🤖 Generated with Claude Code