Whitespace at the beginning of a sentence is ignored in codeblock. #1441

Closed
opened 2026-02-05 00:54:30 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @hhk7734 on GitHub (Nov 5, 2019).

Describe the bug
Whitespace at the beginning of a sentence is ignored in codeblock.

Steps To Reproduce
When using markdown

\```bash
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
...
\```

->

displayed

0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
...

Expected behavior
I want it to displayed as I typed.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.27.5
  • PHP Version: PHP 7.2.19
  • Hosting Method (Nginx/Apache/Docker): Apache/2.4.29
Originally created by @hhk7734 on GitHub (Nov 5, 2019). **Describe the bug** Whitespace at the beginning of a sentence is ignored in codeblock. **Steps To Reproduce** When using markdown ``` \```bash 0 1 2 3 4 5 6 7 8 9 a b c d e f ... \``` ``` -> displayed ``` 0 1 2 3 4 5 6 7 8 9 a b c d e f ... ``` **Expected behavior** I want it to displayed as I typed. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): 0.27.5 - PHP Version: PHP 7.2.19 - Hosting Method (Nginx/Apache/Docker): Apache/2.4.29
OVERLORD added the 🐛 Bug💻 Front-End labels 2026-02-05 00:54:30 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 15, 2019):

Thanks for raising @hhk7734.
Have tested and can confirm this is the case.

Also happens on WYSIWYG, but not in the editor itself. Likely to be this line at play:
189a598d56/resources/js/services/code.js (L102)

Have marked to be fixed for the next release.

@ssddanbrown commented on GitHub (Nov 15, 2019): Thanks for raising @hhk7734. Have tested and can confirm this is the case. Also happens on WYSIWYG, but not in the editor itself. Likely to be this line at play: https://github.com/BookStackApp/BookStack/blob/189a598d560e83e283e8062a73ce8198e5a0553b/resources/js/services/code.js#L102 Have marked to be fixed for the next release.
Author
Owner

@ssddanbrown commented on GitHub (Dec 16, 2019):

Patched in master branch, Will be part of the next feature release (v0.28) due at the end of the year.

@ssddanbrown commented on GitHub (Dec 16, 2019): Patched in master branch, Will be part of the next feature release (v0.28) due at the end of the year.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1441