Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

chrisvanpatten
Copy link
Member

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
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
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.

None yet

3 participants