BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

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

Open nvnvnvnvn opened this issue 7 years ago • 6 comments

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/

nvnvnvnvn avatar Jan 07 '19 17:01 nvnvnvnvn

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 avatar Jan 08 '19 15:01 ssddanbrown

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

nvnvnvnvn avatar Jan 08 '19 15:01 nvnvnvnvn

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 avatar Jan 08 '19 21:01 ssddanbrown

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 avatar Oct 01 '21 04:10 kingfetty

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

phil-ittech avatar Aug 10 '23 23:08 phil-ittech

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.

ssddanbrown avatar Apr 28 '26 12:04 ssddanbrown