Extra paragraphs when reusing entire page
Describe the Bug
When reusing the content of an entire page, extra paragrapshs are added before and after the content.
Steps to Reproduce
- Edit a page
- Reuse the content of an entire page
Expected Behaviour
No extra paragraphs should be added around the contents. The page should be reused directly without blanks before and after
Screenshots or Additional Context

Browser Details
No response
Exact BookStack Version
v22.03.1
PHP Version
No response
Hosting Environment
Uberspace
Thanks for reporting @vdngec.
Can confirm this behaviour. Is due to this system causing nested p tags which are then split out by the browser in an attempt to auto-correct the structure.
Will be tricky to properly address, as will not a more intensive parser solution, especially so when the include tag may be surrounded or within other sections. Can be worked around by manually altering the wrapping tag to be a div instead.
Hi,
I'd like to +1 and report experiencing the same issue. I've also noticed that the collapsible block seems to add similar spacing at the beginning and end if re-using page content in a collapsible block (for example a collapsible block containing just {{@4}} and nothing else will have extra spacing at the top and bottom that is not present on page @4 and that is not present in the collapsible block)
We are using v22.11
Thanks!
My workaround is the following snippet added to Custom HTML Head Content in Settings > Customization:
<style>
/* remove empty p on macro use */
p:empty {
display: none
}
</style>
Within #4688 I've significantly changed how includes are handled. They're now parsed and rendered in a DOM-aware manner, and there's now logic to promote/split/clean-up content to handle it a bit better, including promoting block content to land outside of paragraph tags. The implemented logic is quite specific so somewhat limited (Following all rules of HTML would be very complex) but it should now avoid issues like this in the vast majority of cases.
The changes added will be part of the next feature release.