BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.43k stars 1.94k forks source link

Code blocks are automatically trimmed #5212

Closed Sympatron closed 1 month ago

Sympatron commented 2 months ago

Describe the Bug

All code blocks are automatically trimmed at the end in the viewer. In the editor trailing empty lines are shown, but when viewing a page empty lines at the end are stripped. This is quite annoying, because that means that script I want to copy paste from the block to a shell will not automatically execute the last command, because of the missing new line at the end. Even if the last line contains whitespace it is still stripped.

Steps to Reproduce

  1. Edit a page
  2. Add a code block
  3. Enter code + empty lines
  4. Save
  5. Empty lines are gone

Expected Behaviour

All lines entered in the editor should be shown in the viewer. At the very least non-empty lines (containing only whitespace) should be kept.

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

v24.05.1

ssddanbrown commented 1 month ago

Thanks for reporting @Sympatron, I'm going to close this off though as I feel #2638 already covers this scenario/request.

Sympatron commented 1 month ago

You are right, this is the same issue. I did not find it. But it is open for 3,5 years with no comment so far...