Text Selection Across Multiple Blocks Is Coming to WordPress

Yesterday, Ella van Durpe merged a long-awaited feature into the Gutenberg plugin that allows users to select and modify text across multiple Rich Text blocks. It should land in version 13.0 of the plugin and WordPress 6.0 in May.

Users can currently select text across multiple blocks, but the editor automatically adjusts that selection to all of the blocks themselves, essentially creating a group. The change will allow users to highlight the specific text. This ability should work with any Rich Text block, such as Paragraph, Heading, List, and Quote.

WordPress open to a post with several paragraphs.  Text is selected across two different Paragraph blocks.
Selecting text across two blocks.

Anyone who wants to test this feature early can grab a development copy of Gutenberg from the ticket. Click on the “Build Gutenberg Plugin ZIP” tab.

If there is one thing that any text-based editor should do well, it should be to allow users to manipulate text according to standard conventions. Users should be able to select, copy, cut, paste, and generally move characters and words around as they please.

When WordPress 5.0 launched its new block-based editor in late 2018, some of the tools that writers had expected were non-existent. Every paragraph, list, heading, and blockquote was a separate entity and not simply a continuation of the text. Blocks were the sludge that plugged the editing flow.

The block system solved a ton of problems that needed solutions. The new post editor even looked sleeker than its classic predecessor. But, those things did not matter much when stuff under the hood did not meet the demands users needed of an editor. Every missing feature that had become a standard to any particular user or another was a blight, another one-star review, on the revolution the block system was meant to bring about.

If a user could not do something as simple as select and delete text across two paragraphs, what good were all the other bells and whistles?

It is now over three years since the launch of the block editor. Perhaps it is too late to win back some who have chosen a different path for their websites. For others, maybe their writing flows have changed so drastically that the news is inconsequential. For those who have been patiently waiting, knowing that WordPress would one day make this right, it is a moment to rejoice.

Judging by the response to Matías Ventura’s tweet yesterday, it is a reminder of just how much people have wanted this feature:

The implementation does not yet offer complete coverage of capabilities when selecting text across Rich Text blocks. It currently includes the following:

  • Enter: Hitting the Enter key will delete the selected text and create a new paragraph.
  • Backspace: Hitting the Backspace key removes the selected text and merges anything left of the latter block with the former.
  • Delete: Hitting the Del key removes the selected text and forward merges the previous text.
  • Input: Typing will replace the selected text with new input.

The difference between Backspace and Del is relevant when dealing with different block types. For example, when highlighting text from a list followed by a paragraph, backspacing will merge the remainder of the paragraph text as a list item. When deleting, the list items become paragraphs.

WordPress editor with paragraphs and a list.  The paragraph below the list has been backspaced into it, leaving an empty list item.
Backspacing selected text across List and Paragraph blocks.

I did notice a bug when backspacing into a list. It leaves an empty list item, as shown in the above screenshot.

There is still no current method of selecting text from two or more blocks and copying or cutting it. Attempting this falls back to the previous behavior. The copy/cut action grabs the entire block code instead of the text itself.

Selected text across two paragraphs in the editor.  Both blocks are copied instead of the text itself.
Copy action when selecting partial text.

The new feature does not do away with the ability to partially select text across multiple blocks and manipulate them as a group. Users can still shift their position, copy them, and modify them.

Instead, the text-selection feature is an enhancement to the current tools, and it is one that many will be happy to see land in WordPress. It is not a complete set of capabilities, but this is a win for the project and a necessary step forward.

9 responses to “Text Selection Across Multiple Blocks Is Coming to WordPress”

  1. Everytime this issue came up in GitHub, core devs assured that text selection across multiple blocks couldn’t be achieved because of the technical trade-off of using one block per paragraph. What has changed now?

  2. A decade ago I discovered a plug-in under development called “front end editor” it was great. It allowed users to edit WP pages in a wysiwyg interface, on the front end. It was simple and powerful and it was exactly what I needed for clients because it left the layout locked, but allowed them to edit headlines, text, etc. It was easy to set up, and had a lot of promise as the author seemed in tune with what I hoped for.

    So, I was sad to see the project set aside as initial work began on Gutenberg . I preferred the simplicity of the front end editor. Gutenberg still does not provide a lot of what I need for clients, it’s chaotic ever changing demands on me, and it bombards my editors with conceptual demands, yet still lacks the simple editing tools they demand most . Cross Paragraph selection being a pertinent example.
    Anyway. consequently I still remember the author of that old plug-in as I pinned my hopes on her work back then … Ella van Durpe

  3. This has been my main block complaint since the beginning—an article was no longer something complete, it was a bunch of separate blocks that had no relation to each other. As I have started doing more editing recently and finally switched away from classic editor, I have found it a bit better than the original, but this is a major step forward.
    Coming from a print-layout background (PageMaker > InDesign/Quark > Affinity Publisher) has often been a challenge.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: