Skip to content

Typing ```js doesn't select the right language in SyntaxHighlighter Code block and causes block to crash #41623

Closed
@alexflorisca

Description

@alexflorisca

Description

When typing ```js to bring up a SyntaxHighlighter Code block, it creates the block, but the language is set to empty. Clicking on the language setting makes the block crash. I would expect it to create the SyntaxHighlighter Code block with the JavaScript language selected.

Step-by-step reproduction instructions

  1. Open up the editor
  2. Type: ```js and hit enter
  3. See that the SyntaxHighlighter Code block has been added, but where the language setting should be, there is nothing.
  4. Click on where the language setting should be and the block will crash with a This block has encountered an error and cannot be previewed. error.

Screenshots, screen recording, code snippet

Screen.Recording.2022-06-09.at.13.08.09.mov

Environment info

Wordpress 6.0, Gutenberg not installed, P2 theme
Mac OS
Chrome v101

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions