Created code blocks are buggy until saving page #2677

Closed
opened 2026-02-05 04:46:13 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Szwendacz99 on GitHub (Feb 27, 2022).

Describe the Bug

Problematic behavior of code blocks that are just created (tested in private windows to make sure any local cache does not make troubles):

on Firefox:

  • new code block once closed is not editable until saving page and reopening editor
  • cannot delete new code block until reopening editor
  • when trying to add new unformatted line after new code block (by enter) it adds empty line only visually (its gone after saving the page) inside the code block instead (this is sometimes not gone after saving page, probably depends if the code block was the last element of page)

on Brave:

  • new code block once closed is not editable until saving page and reopening editor
  • cannot move caret next to new code block so it is impossible to add new line after it if this code block is the last element on the page (this is also fixed by saving page)

Steps to Reproduce

  1. open editor for any page
  2. Crtl+7 to create new block
  3. save this block
  4. behavior of the newly created block is as in the description of the bug

Expected Behaviour

Behavior from description does not occur.

Screenshots or Additional Context

empty, only visually added lines when trying to add new unformatted lines after code block in Firefox:
image

Exact BookStack Version

v22.02

PHP Version

8.0.8

Hosting Environment

Tested on official demo and my setup which basically is in Docker containers:

  • apache reverse-proxy
  • php 8.0.8
Originally created by @Szwendacz99 on GitHub (Feb 27, 2022). ### Describe the Bug Problematic behavior of code blocks that are just created (tested in private windows to make sure any local cache does not make troubles): on Firefox: - new code block once closed is not editable until saving page and reopening editor - cannot delete new code block until reopening editor - when trying to add new unformatted line after new code block (by enter) it adds empty line only visually (its gone after saving the page) inside the code block instead (this is **sometimes not** gone after saving page, probably depends if the code block was the last element of page) on Brave: - new code block once closed is not editable until saving page and reopening editor - cannot move caret next to new code block so it is impossible to add new line after it if this code block is the last element on the page (this is also fixed by saving page) ### Steps to Reproduce 1. open editor for any page 2. Crtl+7 to create new block 3. save this block 4. behavior of the newly created block is as in the description of the bug ### Expected Behaviour Behavior from description does not occur. ### Screenshots or Additional Context empty, only visually added lines when trying to add new unformatted lines after code block in Firefox: ![image](https://user-images.githubusercontent.com/68295743/155878750-373ca1b0-c353-4ce7-b5c3-5fb795806674.png) ### Exact BookStack Version v22.02 ### PHP Version 8.0.8 ### Hosting Environment Tested on official demo and my setup which basically is in Docker containers: - apache reverse-proxy - php 8.0.8
OVERLORD added the 🐛 Bug label 2026-02-05 04:46:13 +03:00
Author
Owner

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

Thank for reporting @Szwendacz99.
I have made a range of changes in 0de4d6d223 which should fix the experienced issues based on my testing, for the next patch release, but let me know if if still have issues after upgrading to that release (Once its out).

@ssddanbrown commented on GitHub (Feb 27, 2022): Thank for reporting @Szwendacz99. I have made a range of changes in 0de4d6d22342fa5a84393e5e18ff59fe42cbb876 which should fix the experienced issues based on my testing, for the next patch release, but let me know if if still have issues after upgrading to that release (Once its out).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2677