Skip to content

Add "img" as a keyword for the image block#10955

Merged
chrisvanpatten merged 2 commits into
WordPress:masterfrom
TomodomoCo:add/img-keyword-for-image-block
Oct 23, 2018
Merged

Add "img" as a keyword for the image block#10955
chrisvanpatten merged 2 commits into
WordPress:masterfrom
TomodomoCo:add/img-keyword-for-image-block

Conversation

@chrisvanpatten
Copy link
Copy Markdown
Contributor

This adds "img" as a keyword for the image block, mirroring the HTML <img> tag.

Because this is intended to mirror the HTML tag, I did not wrap this string in a translation method as HTML doesn't translate.

This is in response to Jeff Chandler's [feedback on Twitter](https://twitter.com/jeffr0/status/1054550924541210625_:

Well, I created a new block and was doing that / shortcut thing but when I typed /img Imgur showed up instead of image block.

We already support h* keywords for the Heading block and the blockquote keyword for the Quote block; this is a natural extension of that behavior.

@chrisvanpatten chrisvanpatten added the [Type] Enhancement A suggestion for improvement. label Oct 23, 2018
@chrisvanpatten chrisvanpatten requested a review from a team October 23, 2018 14:30
Copy link
Copy Markdown
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is intended to mirror the HTML tag, I did not wrap this string in a translation method as HTML doesn't translate.

If it's potentially confusing for a future maintainer, could be good to note via an inline comment.

@chrisvanpatten chrisvanpatten merged commit 6715560 into WordPress:master Oct 23, 2018
@chrisvanpatten chrisvanpatten deleted the add/img-keyword-for-image-block branch October 23, 2018 15:15
@chrisvanpatten chrisvanpatten added this to the 4.2 milestone Oct 23, 2018
@mtias mtias added the [Block] Image Affects the Image Block label Oct 23, 2018
antpb pushed a commit to antpb/gutenberg that referenced this pull request Oct 26, 2018
* Add "img" as a keyword for the image block

* Add comment for future maintainers on why we don't translate "img"
@mtias
Copy link
Copy Markdown
Member

mtias commented Oct 30, 2018

Thanks for this change, it's a nice little experience improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Image Affects the Image Block [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants