Support grouping of content element in the page editor using a div
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:
- Edit page
- Add
<div id="div-disappears">before paragraphs and</div>after paragraphs - Save
- 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/
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.
Thanks Dan, is there some other work around so the reusing content feature can work?
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.
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
@ssddanbrown - Are there any plans to add the above suggestion as a feature please? Thanks.
BookStack is now managed on Codeberg.
As part of this change, we're closing all existing GitHub issues and pull requests. You'll instead find this issue on Codeberg here: https://codeberg.org/bookstack/bookstack/issues/1209
Any further discussion for this will now be done on Codeberg. Therefore this GitHub thread will be locked.