Support grouping of content element in the page editor using a div #980

Open
opened 2026-02-04 23:15:32 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @nvnvnvnvn on GitHub (Jan 7, 2019).

Describe the bug
Adding div elements in source code but they get removed after exiting the editor

Steps To Reproduce
Steps to reproduce the behavior:

  1. Edit page
  2. Add <div id="div-disappears"> before paragraphs and </div> after paragraphs
  3. Save
  4. Go back in and div is gone

Expected behavior
Would expect the div to remain

Your Configuration (please complete the following information):

  • V22.0

  • 7

  • Nginx/Apache

  • tried in FF and Chrome Browsers

Additional context
Also tried putting paragraph tag instead of div tag to contain all the other elements but that was getting removed as well....sorta. It would end the opening paragraph tag, then have all the other content, then have additional paragraph tag at the end. It was also renaming my ID when doing it with the paragraph element.

Trying to section content for reusing sections of a page in other pages as described here:
https://www.bookstackapp.com/docs/user/reusing-page-content/

Originally created by @nvnvnvnvn on GitHub (Jan 7, 2019). **Describe the bug** Adding div elements in source code but they get removed after exiting the editor **Steps To Reproduce** Steps to reproduce the behavior: 1. Edit page 2. Add `<div id="div-disappears">` before paragraphs and `</div>` after paragraphs 3. Save 4. Go back in and div is gone **Expected behavior** Would expect the div to remain **Your Configuration (please complete the following information):** - V22.0 - 7 - Nginx/Apache - tried in FF and Chrome Browsers **Additional context** Also tried putting paragraph tag instead of div tag to contain all the other elements but that was getting removed as well....sorta. It would end the opening paragraph tag, then have all the other content, then have additional paragraph tag at the end. It was also renaming my ID when doing it with the paragraph element. Trying to section content for reusing sections of a page in other pages as described here: https://www.bookstackapp.com/docs/user/reusing-page-content/
OVERLORD added the 🔨 Feature Request label 2026-02-04 23:15:32 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 8, 2019):

Yeah, The WYSIWYG editor will generally reformat input to keep it clean. I think it'll generally try to keep to one level of block elements.

Could force the editor to be more flexible but it does have potential to create future compatibility issues, would prefer not to go down that route.

@ssddanbrown commented on GitHub (Jan 8, 2019): Yeah, The WYSIWYG editor will generally reformat input to keep it clean. I think it'll generally try to keep to one level of block elements. Could force the editor to be more flexible but it does have potential to create future compatibility issues, would prefer not to go down that route.
Author
Owner

@nvnvnvnvn commented on GitHub (Jan 8, 2019):

Thanks Dan, is there some other work around so the reusing content feature can work?

@nvnvnvnvn commented on GitHub (Jan 8, 2019): Thanks Dan, is there some other work around so the reusing content feature can work?
Author
Owner

@ssddanbrown commented on GitHub (Jan 9, 2019):

The feature should still work, You just can't group up a bunch of block-level elements. So you could use multiple include tags or include all the content from the page instead of a specific section. Can see why you might want to group bits up though.

@ssddanbrown commented on GitHub (Jan 9, 2019): The feature should still work, You just can't group up a bunch of block-level elements. So you could use multiple include tags or include all the content from the page instead of a specific section. Can see why you might want to group bits up though.
Author
Owner

@kingfetty commented on GitHub (Oct 1, 2021):

It seems to me the WSIWYG way of grouping would be via Header levels. If you could somehow pick a header level to imbed within another page via tag/id and have it include everything until the next superior header that would be ideal.

Example:

H1

  • H2
    -- H3
  • H2
    -- H3

H1

If I were to embed from the first H1, it would include up to but not including the next H1, but if I embed the first H2 it would embed up to but not including the next H2

@kingfetty commented on GitHub (Oct 1, 2021): It seems to me the WSIWYG way of grouping would be via Header levels. If you could somehow pick a header level to imbed within another page via tag/id and have it include everything until the next superior header that would be ideal. Example: H1 - H2 -- H3 - H2 -- H3 H1 If I were to embed from the first H1, it would include up to but not including the next H1, but if I embed the first H2 it would embed up to but not including the next H2
Author
Owner

@phil-ittech commented on GitHub (Aug 11, 2023):

@ssddanbrown - Are there any plans to add the above suggestion as a feature please? Thanks.

@phil-ittech commented on GitHub (Aug 11, 2023): @ssddanbrown - Are there any plans to add the above suggestion as a feature please? Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#980