Skip to content

Fix toggle code block button in the Content Editor

Enrique Alcántara requested to merge 349530-fix-code-block-toggle-button into master

What does this MR do and why?

This MR fixes a bug in the Content Editor where the code block toolbar button inserts a frontmatter block instead. See the screenshots for a demonstration.

Why is this happening?

The frontmatter extension inherits from the code block extension. It is inheriting the setCodeBlock and toggleCodeBlock commands. This creates a conflict where the Frontmatter extension overwrite the original purpose of those commands and insert frontmatter nodes instead.

Screenshots or screen recordings

Before After
2022-01-12_09.27.56 2022-01-12_09.35.37

How to set up and validate locally

  1. Edit or create a new Wiki page
  2. Choose to edit the page using the Content Editor
  3. Insert a code block as demonstrated in the screenshots above.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #349530 (closed)

Edited by Enrique Alcántara

Merge request reports