Support code syntax highlighting in exports #5177

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

Adding <code> blocks with the internal «CodeMirror» editor result in a good highlighted render of code in standard book view; however, when the page is exported to «Contained Html File», no highlight is applied.

<code> blocks highlight isn't rendered in the «Contained html ...» and code is rendered with non-highlighted code blocks style.

Steps to Reproduce

  1. Create a simple page and add any program code of any of the supported languages
  2. After «page save», code is displayed with syntax highlight
  3. Export to «Contained Html File»
  4. Open the result HTML file and code is rendered as a code badge, without any syntax highlighting

Expected Behaviour

Get the same rendering inside BookstackApp and in the exported «Contained Html File»

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 Adding `<code>` blocks with the internal «CodeMirror» editor result in a good highlighted render of code in standard book view; however, when the page is exported to «Contained Html File», no highlight is applied. `<code>` blocks highlight isn't rendered in the «Contained html ...» and code is rendered with non-highlighted code blocks style. ### Steps to Reproduce 1. Create a simple page and add any program code of any of the supported languages 2. After «page save», code is displayed with syntax highlight 3. Export to «Contained Html File» 4. Open the result HTML file and code is rendered as a code badge, without any syntax highlighting ### Expected Behaviour Get the same rendering inside BookstackApp and in the exported «Contained Html File» ### 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#5177