Problem/Motivation

Instead of doing #3263384: Add ckeditor5-code-block package and CodeBlock plugin and the various blockers, have a simple "PRE" custom button to avoid people having to use source editing for this and leave the upgrade path to contrib (specifically https://www.drupal.org/project/codesnippet)

Issue fork drupal-3269059

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nod_ created an issue. See original summary.

nod_’s picture

Title: Add a <pre> button to CKEditor 5 for the upgrade path from CKEditor 4 format dropdown » [PP-1] Add a <pre> button to CKEditor 5 for the upgrade path from CKEditor 4 format dropdown
Related issues: +#3268174: Bug in CKE 4 → 5 upgrade path "format" does not always map to "heading", it could map to "codeBlock" too, or both, or neither

wim leers’s picture

Issue tags: +Needs screenshots

There's no commits pushed here yet, so I can't see what it does/what the UX is yet 🤓

lauriii’s picture

Priority: Normal » Critical
Parent issue: » #3238333: Roadmap to CKEditor 5 stable in Drupal 9

I think we should integrate the new button to the heading plugin since it already provides an API that allows us to add additional elements to the dropdown. This would provide feature parity to CKEditor 4 and we wouldn't worry about issues with element conversion (heading to <pre> or <pre> to <p> etc). If we created a completely new button, we would also have to figure out UX for it, including design for a button.

Adding screenshot from CKEditor 4 here:

wim leers’s picture

nod_’s picture

Status: Active » Postponed
nod_’s picture

Status: Postponed » Closed (won't fix)

closing, other solution works fine too.

vitaliyb98’s picture

Issue tags: -JavaScript +JavaScript

Added a simple module that integrates the <pre> tag into the CKEditor headings dropdown https://www.drupal.org/project/ckeditor5_pre