Skip to content

ToC block: handle newlines #41203

@simison

Description

@simison

Description

Heading blocks can contain newlines (shift+enter) but ToC block won't show them:

Screenshot 2022-05-20 at 17 16 17

Step-by-step reproduction instructions

  1. Add Table of Contents block
  2. Add heading block
  3. Enter text, create new line within heading (shift+enter), and enter more text
  4. See how ToC block doesn't contain the newline

Screenshots, screen recording, code snippet

I got around the problem by adding a space before newline:

Screenshot 2022-05-20 at 17 16 24

Environment info

  • Gutenberg: v13.3.0-rc.1

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

Yes

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

No

FYI @ZebulanStanphill

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions