HTML Code gets changed when saved #5162

Closed
opened 2026-02-05 09:45:12 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @BenRabia99 on GitHub (Jan 31, 2025).

Describe the Bug

If I insert HTML code as a code block and then save it, BookStack changes the formatting of the code.

Steps to Reproduce

  1. Paste some HTML codeblock into the the page
  2. save it
  3. reopen the code block insert feature
  4. check if the code is still the same

Expected Behaviour

I'd expectet to just show the HTML code which i inserted.

Screenshots or Additional Context

Image
Image

Browser Details

Mozilla Firefox 128.6.0esr

Exact BookStack Version

BookStack v24.12.1

Originally created by @BenRabia99 on GitHub (Jan 31, 2025). ### Describe the Bug If I insert HTML code as a code block and then save it, BookStack changes the formatting of the code. ### Steps to Reproduce 1. Paste some HTML codeblock into the the page 2. save it 3. reopen the code block insert feature 4. check if the code is still the same ### Expected Behaviour I'd expectet to just show the HTML code which i inserted. ### Screenshots or Additional Context ![Image](https://github.com/user-attachments/assets/41dac84c-e8e8-4989-b74f-999f3749b7e0) ![Image](https://github.com/user-attachments/assets/04a9ddce-4132-4123-9d08-58b4aff93a01) ### Browser Details Mozilla Firefox 128.6.0esr ### Exact BookStack Version BookStack v24.12.1
OVERLORD added the 🐛 Bug label 2026-02-05 09:45:12 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 31, 2025):

The editor can perform various filtering, cleanup, standardization and reformatting.
We don't provide any assurances that code added via the source input will remain as-is.
Further changes and filtering may be made by the back-end also upon save.

@ssddanbrown commented on GitHub (Jan 31, 2025): The editor can perform various filtering, cleanup, standardization and reformatting. We don't provide any assurances that code added via the source input will remain as-is. Further changes and filtering may be made by the back-end also upon save.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5162