Ad an additional Paragraph when codesnippet is inserted via ckeditor button.

Created on 11 March 2025, about 1 month ago

Problem/Motivation

When I insert a code snippet via the CK-Editor button, I often do this while I transfer the code shown in the article directly from a command line or from an IDE into an article.

Currently, every time this is done, I have to press the source code button in CK-Editor and then manually add a < p > < /p> after the pasted section so that I can continue writing. From my point of view, this is a step that the module should take care of.
The aim of the exercise is to ensure that a user's workflow is not interrupted when writing an article with code examples.

Steps to reproduce

Install the Module
Enable the Module
Set up Input filter and Insert button in yorur desiredtext input format.
save the configuration change
create a new post (article) by useing the corrosponding input format.
write some introduction
insert a snippet
try to continue writing afte inserting code via ck editor button is finished. e. g. try to klick below your code example and press some letters on your keybord, ect.

Proposed resolution

Change business logic for inserting ssnipped wrrapper to add a paragraph as last tag after snipped insert code.

Remaining tasks

Create a patch

User interface changes

None

API changes

TBD

Data model changes

TBD

Feature request
Status

Active

Version

1.1

Component

Code

Created by

🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @joachim namyslo
  • 🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺
  • 🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺
  • 🇩🇪Germany joachim namyslo Kulmbach 🇩🇪 🇪🇺

    Update.

    It seems the business logig is there, And the issue occoures beacause the text arrea field looses focus after code was insertet. So if you don't feel the logig behind that should be changed this should be documented at least.

    The Issue can be solved by
    1. Insert code
    2. Click into the text area again.
    3. user the right or left arrow key depending on your reading direction. to get your corser back
    4. hit return.

    Theese are additional steps after inserting code while if a paragraph would be added here it'll more obvious to most users that they have to click below the code insert to continue writing.

Production build 0.71.5 2024