ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.51k stars 3.7k forks source link

Autoformatting for block code does not allow language type #8437

Open godai78 opened 3 years ago

godai78 commented 3 years ago

📝 Provide detailed reproduction steps (if any)

  1. Adding a code block with the autoformatting function.
  2. Turns into block automatically immediately after typing ```.
  3. Does not let me type the language name.

✔️ Expected result

I would like to add a language type to the code block.

❌ Actual result

The code blocks by default turn into plain text block without any ability to control/change it.

📃 Other details


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

oleq commented 3 years ago

@godai78 Can you point us to an existing application where the feature works as expected? Have you seen this before somewhere? (web app, native app, etc.)

godai78 commented 3 years ago

Haven't seen this introduced via shortcode. Only by a UI interface item and this works just fine in CKE5. I'll search the web for that, though.

Right now the markdown syntax is converted immediately after the last ` is added. IF this waited for either a language code (like PHP of HTML) or space and only THEN convert, this would do the trick.

kohheepeace commented 3 years ago

@oleq Hi, I also want this feature.

Current ```, then insert code block.

gif

Expected ```language + ENTER, insert code block and set language.

gif

https://kohheepeace.github.io/slate-tuto/

blark commented 2 years ago

For an ideal implementation of this feature check out the Typora markdown editor.

(1) When you type ```c it offers to auto-complete based on known languages. (2) Then you can change the language easy after the fact by simply clicking on the chosen language:

Example 1

Example 2

As a customer about to purchase CKEditor5 we'd really love to see this feature added - thanks.

CKEditorBot commented 1 year ago

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

godai78 commented 1 year ago

This should not be closed.

CKEditorBot commented 1 week ago

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.