Support tag classes in export formats #5176

Open
opened 2026-02-05 09:46:13 +03:00 by OVERLORD · 0 comments
Owner

Originally created by @DoctorRetromaker on GitHub (Feb 9, 2025).

Describe the Bug

When exporting «books», «chapters» or «pages», appended tags to any of them aren't exported in the resulting «Contained Web File».

Isn't tested in other export options, but there is no reason to expect different behavior.

This is inconsistent with the «tags hacking proposal», because any CSS styles based on «tags» correctly working on standard view, will fail in the exported «contained html».

Steps to Reproduce

  1. Add any «tag» to a «book», «chapter» or «page» ..
  2. Create a custom CSS file including any style applied only with the «tag-css-class»
  3. Create a simple HTML page with any text that include the «tag-css-class» to modify the standard style
  4. Export to «Contained Web File»
  5. ... and «voilà», the «tag-css-class» controlled style don't work, just because the «tags-css-classes» aren't included

Expected Behaviour

All «book», «chapter» or «page» «tag-css-class» should be included in the «Contained Web File» « class» attribute.

If there are repeated tags, only one must be included; it is a user responsibility to design a good «tags hacking» strategy

Screenshots or Additional Context

No response

Browser Details

Brave 1.175.175

Exact BookStack Version

24.12.1

Originally created by @DoctorRetromaker on GitHub (Feb 9, 2025). ### Describe the Bug When exporting «books», «chapters» or «pages», appended tags to any of them aren't exported in the resulting «Contained Web File». Isn't tested in other export options, but there is no reason to expect different behavior. This is inconsistent with the «tags hacking proposal», because any CSS styles based on «tags» correctly working on standard view, will fail in the exported «contained html». ### Steps to Reproduce 1. Add any «tag» to a «book», «chapter» or «page» .. 2. Create a custom CSS file including any style applied only with the «tag-css-class» 3. Create a simple HTML page with any text that include the «tag-css-class» to modify the standard style 4. Export to «Contained Web File» 5. ... and «voilà», the «tag-css-class» controlled style don't work, just because the «tags-css-classes» aren't included ### Expected Behaviour All «book», «chapter» or «page» «tag-css-class» should be included in the «Contained Web File» «<BODY> class» attribute. If there are repeated tags, only one must be included; it is a user responsibility to design a good «tags hacking» strategy ### Screenshots or Additional Context _No response_ ### Browser Details Brave 1.175.175 ### Exact BookStack Version 24.12.1
OVERLORD added the 🔨 Feature Request label 2026-02-05 09:46:13 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5176