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
merged 2 commits into from Oct 23, 2018

Conversation

Projects
None yet
3 participants
@chrisvanpatten
Contributor

chrisvanpatten commented Oct 23, 2018

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 requested a review from WordPress/gutenberg-core Oct 23, 2018

@aduth

aduth approved these changes Oct 23, 2018

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

2 checks passed

codecov/project 48.76% remains the same compared to 77fab02
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@chrisvanpatten chrisvanpatten deleted the TomodomoCo:add/img-keyword-for-image-block branch Oct 23, 2018

@chrisvanpatten chrisvanpatten added this to the 4.2 milestone Oct 23, 2018

@mtias mtias added the [Block] Image label Oct 23, 2018

antpb added a commit to antpb/gutenberg that referenced this pull request Oct 26, 2018

Add "img" as a keyword for the image block (WordPress#10955)
* Add "img" as a keyword for the image block

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

This comment has been minimized.

Contributor

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