Custom div with class #1721

Closed
opened 2026-02-05 01:42:37 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @RodriAndreotti on GitHub (May 8, 2020).

Describe the feature you'd like
Can I add a custom div with a custom css class on editor? In custom code I add a div, but it removes css class

Describe the benefits this feature would bring to BookStack users
Width this we can achieve to create some layout types with columns or even include videos with responsive css..

Originally created by @RodriAndreotti on GitHub (May 8, 2020). **Describe the feature you'd like** Can I add a custom div with a custom css class on editor? In custom code I add a div, but it removes css class **Describe the benefits this feature would bring to BookStack users** Width this we can achieve to create some layout types with columns or even include videos with responsive css..
Author
Owner

@ssddanbrown commented on GitHub (May 15, 2020):

Hi @RodriAndreotti,
A range of custom content is purposefully filtered out in the editor to attempt to keep content limit to that which can be supported by other parts of the app and future changes.

We do have some editor events, which could allow altering of the editor config (Including content filtering options) but any such changes are unsupported by the platform.
Details on editor events can be found here:
https://www.bookstackapp.com/docs/admin/hacking-bookstack/#bookstack-editor-events

@ssddanbrown commented on GitHub (May 15, 2020): Hi @RodriAndreotti, A range of custom content is purposefully filtered out in the editor to attempt to keep content limit to that which can be supported by other parts of the app and future changes. We do have some editor events, which could allow altering of the editor config (Including content filtering options) but any such changes are unsupported by the platform. Details on editor events can be found here: https://www.bookstackapp.com/docs/admin/hacking-bookstack/#bookstack-editor-events
Author
Owner

@RodriAndreotti commented on GitHub (May 15, 2020):

Hi, @ssddanbrown !
Thank you by feedback.

Actually, some level of filtering is always necessary, in my case I am using bookstak to create the administration panel documentation for the sites I develop, and some level of customization of the elements is sometimes necessary, for example image alignment to the left or right (this I managed to solve using the source code editor), but placing content in columns and / or responsive videos using custom css was not possible precisely by filtering classes in the div.

By the way, thanks again for the feedback.

@RodriAndreotti commented on GitHub (May 15, 2020): Hi, @ssddanbrown ! Thank you by feedback. Actually, some level of filtering is always necessary, in my case I am using bookstak to create the administration panel documentation for the sites I develop, and some level of customization of the elements is sometimes necessary, for example image alignment to the left or right (this I managed to solve using the source code editor), but placing content in columns and / or responsive videos using custom css was not possible precisely by filtering classes in the div. By the way, thanks again for the feedback.
Author
Owner

@lenusch commented on GitHub (Sep 11, 2020):

So is it possible to have custom css class on div inside of page? This something just normal things. Why strip css class away? i want to give a DIV a class so i can have Button styling in my Page. :-S

@lenusch commented on GitHub (Sep 11, 2020): So is it possible to have custom css class on div inside of page? This something just normal things. Why strip css class away? i want to give a DIV a class so i can have Button styling in my Page. :-S
Author
Owner

@ssddanbrown commented on GitHub (Sep 13, 2020):

@lenusch

So is it possible to have custom css class on div inside of page?

Not without altering the editor config using the editor events link I posted above or using the markdown editor (Although content will be re-stripped if edited again within the WYSIWYG editor)

Why strip css class away?

To keep the included content to that which BookStack supports and to stop potential clashing with existing styles.

Just an additional note, Although it's possible to override the editor config to allow more styles, it may cause you issues in the future upon upgrades where your custom additions are not accounted for.

I'm going to close this off as custom classes within page content is not something I'd be looking to support by default due to the above.

@ssddanbrown commented on GitHub (Sep 13, 2020): @lenusch > So is it possible to have custom css class on div inside of page? Not without altering the editor config using the editor events link I posted above or using the markdown editor (Although content will be re-stripped if edited again within the WYSIWYG editor) > Why strip css class away? To keep the included content to that which BookStack supports and to stop potential clashing with existing styles. Just an additional note, Although it's possible to override the editor config to allow more styles, it may cause you issues in the future upon upgrades where your custom additions are not accounted for. I'm going to close this off as custom classes within page content is not something I'd be looking to support by default due to the above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1721