Gutenberg 13.9 Adds New Shortcut to Wrap Selected Text in Quotes

Wouldn’t or not it’s handy to pick out a sentence or paragraph and immediately wrap it with quotes by tapping on the quote key? This can be a enjoyable little function that was tucked into the Gutenberg 13.9 changelog final month with little or no fanfare:

Wealthy textual content: Add character shortcuts for wrapping choice. (42469)

The brand new shortcut is a wealthy textual content function contributed by Automattic-sponsored WordPress core committer Ella van Durpe. It really works in an identical method that pasting a link over selection will auto-link the textual content as an alternative of substitute it, a function that landed seven years in the past which she additionally labored on.

The brand new quotes shortcut escaped my discover till I noticed George Mamadashvili’s fast video demo on Twitter:

This can be a intelligent function that’s generally supported by IDE’s like IntelliJ and PyCharm. Though wrapping with quotes is probably going the commonest use case for this kind of shortcut, it additionally helps wrapping the choice with a again tick (`), which can routinely wrap it in a code tag as an alternative of changing the choice with a again tick. van Durpe demonstrated this within the PR with a gif:

When you continuously copy and paste textual content that’s meant to be in quotes, or code that wants backticks, this new shortcut is a significant timesaver and some of the thrilling options to land in 13.9. van Durpe stated it was generalized to work with any characters, comparable to urgent ( to wrap the choice in parenthesis, as an alternative of deleting the choice. Nonetheless, this was scaled again a bit in the course of the evaluation earlier than the PR was merged.

“I’m a bit frightened with increasing these to characters which can be pure openers as a result of I think it’s a typical motion to pick out a phrase and kind the primary letter of what ought to substitute it — parentheses and citation marks, specifically, would have a a lot increased incidence of circumstances the place the intention is certainly to exchange the chosen textual content with the mark, to not wrap it in them,” Gutenberg lead architect Matias Ventura stated.

Ventura concluded that it’s value testing however steered extra characters be added incrementally to focus function bulletins on those they’re extra sure about “with out those that could possibly be problematic tainting the function.” That is presumably the explanation it wasn’t highlighted within the launch submit.

The backtick and quote characters are the one two included on this iteration of the function. It’s not simple for customers to find within the pure course of utilizing the editor, so it’d want a bit promotion for folks to start out utilizing it sufficient to know if it’s going to develop into a kind of indispensable options or one thing that’s inadvertently inflicting frustration.

Leave a Reply

Your email address will not be published. Required fields are marked *