[Bug Report]: selecting multiple lines to make them code block #2603

Closed
opened 2026-02-05 04:36:08 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @noxtras on GitHub (Jan 25, 2022).

Describe the Bug

When I have multiple lines and I select them and click on 'code block', all the paragraphs on the page get smushed to one line.
Strangely, if I select the same paragraphs and select block quote, it works perfectly.
Unrelated, but requires same bug fix: If I shift+enter some lines and then select code block, the entire paragraph gets smushed to a single line inside the code block. Again, block quote works as expected.

Steps to Reproduce

New document
add a few lines of text, some with SHIFT+ENTER
select 2 lines from either the enter delimited and shift+enter delimited text and click code block.

Expected Behaviour

It has to be like the block quote, retain line endings, so if you have 2 lines with an ENTER between them (2 paragraphs), the code block needs to be "line1, empty line, line2" , and if you have a paragraph with multiple lines, it needs to be "line1,line2".

Screenshots or Additional Context

No response

Exact BookStack Version

v21.12.2

PHP Version

7.4

Hosting Environment

Ubuntu 20.4 LTS

Originally created by @noxtras on GitHub (Jan 25, 2022). ### Describe the Bug When I have multiple lines and I select them and click on 'code block', all the paragraphs on the page get smushed to one line. Strangely, if I select the same paragraphs and select block quote, it works perfectly. Unrelated, but requires same bug fix: If I shift+enter some lines and then select code block, the entire paragraph gets smushed to a single line inside the code block. Again, block quote works as expected. ### Steps to Reproduce New document add a few lines of text, some with SHIFT+ENTER select 2 lines from either the enter delimited and shift+enter delimited text and click code block. ### Expected Behaviour It has to be like the block quote, retain line endings, so if you have 2 lines with an ENTER between them (2 paragraphs), the code block needs to be "line1, empty line, line2" , and if you have a paragraph with multiple lines, it needs to be "line1,line2". ### Screenshots or Additional Context _No response_ ### Exact BookStack Version v21.12.2 ### PHP Version 7.4 ### Hosting Environment Ubuntu 20.4 LTS
OVERLORD added the 🐛 Bug📝 WYSIWYG Editor labels 2026-02-05 04:36:08 +03:00
Author
Owner

@bourdaisj commented on GitHub (Jan 30, 2022):

I will look into this and try to provide a fix

@bourdaisj commented on GitHub (Jan 30, 2022): I will look into this and try to provide a fix
Author
Owner

@noxtras commented on GitHub (Jan 30, 2022):

Thank you. I'm reporting these bugs, for a more complete list of them. Bookstack is amazing as it is. I've moved from Confluence, that constantly crashed (some ini file).
I hope you don't, but please don't feel like you have to fix these reported issues with priority, or at all.

@noxtras commented on GitHub (Jan 30, 2022): Thank you. I'm reporting these bugs, for a more complete list of them. Bookstack is amazing as it is. I've moved from Confluence, that constantly crashed (some ini file). I hope you don't, but please don't feel like you have to fix these reported issues with priority, or at all.
Author
Owner

@ssddanbrown commented on GitHub (Feb 6, 2022):

This should now be addressed thanks to @Julesdevops in #3246 and some follow up changes in b2f863e1f1. This will be part of the next patch release.

Thanks for reporting @noxtras! Suprised this was not raised earlier to be honest, especially since it attempted to make the whole page into a code block 🙀

@ssddanbrown commented on GitHub (Feb 6, 2022): This should now be addressed thanks to @Julesdevops in #3246 and some follow up changes in b2f863e1f18ab9997dc43178ef53bc04b849e10c. This will be part of the next patch release. Thanks for reporting @noxtras! Suprised this was not raised earlier to be honest, especially since it attempted to make the whole page into a code block :scream_cat:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2603