Inline code in comments disappear #6003
[Go]
Labels
No labels
Focus: A11y
Focus: Admin/Meta
Focus: Authentication
Focus: Back-End
Focus: Database
Focus: Design & UX
Focus: Editor - Markdown
Focus: Editor - WYSIWYG
Focus: Export System
Focus: Front-End
Focus: Translations
Focus: View Customization
Is: Docs Update
Is: Enhancement
Is: Priority
Is: Security
Is: Upstream
Status
Blocked
Status
Open to discussion
Status
Out of scope
Status
Pending Validation
Type
API Request
Type
Bug Report
Type
Feature Request
Type
Happy feedback
Type
Maintenance
Type
Question
Type
Support
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bookstack/bookstack#6003
Write
Preview
Loading
Add table
| Rows | |
| Columns |
Cancel
OK
Add a link
Url
Description
Hint: With a URL in your clipboard, you can paste directly into the editor to create a link.
Cancel
OK
Cancel
Save
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
No
Yes
Describe the Bug
When adding a new or editing an existing comment on a page, I can press
ctrl+8to add text formatted as Inline Code.After saving the comment, everything added as Code is gone. It is not, that the code-formatting would not work, but the text itself is gone.
Steps to Reproduce
ctrl+8, add some code, Pressctrl+8again. -> the code is visible in the comment- editor, inside the tags<code><span class="editor-theme-code"><code>-tags nor the text.Expected Behaviour
Code in Comment should be visible.
Ideally it would be inside
<code>-Tags as it is with code in other parts of a page.Screenshots or Additional Context
While
ctrl+8seems to work in the editor, but not while saving; most other shortcuts from the normal editor do not work at all and produce a javascript-error:ctrl+[1-4]ctrl+6/ctrl+Qctrl+7/ctrl+Ectrl+9all give the following error on the javascript-console:
wysiwyg.js?version=v25.12.2:13 TypeError: Cannot read properties of null (reading 'open')As these are the shortcuts with no equivalent Icon in the Comment-Editor; and as the shortcuts for commends with an Icon (
ctrl+b,ctrl+i,ctrl+o,ctrl+p,ctrl+shift+k) do work as expected, I guess this is not an unexpected behaviour.But
ctrl+8seems to be a different case, as it seems to be working correctly while editing, but not on saving.As source code in comments seems to have worked earlier, I guess this is a problem with the new WYSIWYG-Editor
Browser Details
Firefox 147.0.1 (64-Bit) on Windows 11
Exact BookStack Version
v25.12.2
Stumbled upon this issue when trying to figure out why comments added via the API didn't have code formatting. I'm using v25.12.3.
edit: Looking at it closer, the issue seems to be even "deeper" on the API-side. The API expects html-content via the
htmlparameter, and even if you feed it content like the following;or:
Both of these entries are "sucess"/OK (based on the API-response), but the content stored in the database is completely blank (i.e. not even the normal text of the first example is stored).
Thanks for reporting @mueller-contria, and for the extra input @joachimtingvold
The description/comment editors are (purposefully) cut down minimal versions of the main page editor, with stricter back-end content control/filtering. I had left the same range of shortcuts active though, leading to this scenario where inline code could be used but was then filtered out on the back-end.
In #6100 I've updated things so now only relevant shortcuts are registered, and I've added inline code as a supported type for the minimal editor (with its button also added to the toolbar).
These changes will be part of the next feature release.
Code blocks will still not be supported, you may find these are either removed, or become inline code sections.
If there's a need for these, I'd welcome a specific feature request to be raised for consideration.