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

feat(gatsby-remark-images): handle image references #11086

Merged
merged 8 commits into from
Jan 30, 2019

Conversation

artbycrunk
Copy link
Contributor

Description

Hey guys this is a fix for gatsby-remark-images to pickup and process imageReference nodes correctly.
enabling the following syntax

[header]: header.jpg "Logo Title Text 2"

![alt text][header]

Related Issues

Fixes #11085

Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

This is looking great. Would you be able to add any tests and/or snapshots to validate this functionality?

@artbycrunk
Copy link
Contributor Author

@DSchau have added in some test and snapshots to validate the following

it transforms image references in markdown (snapshot)
it leaves orphan image references alone
it transforms multiple image references in markdown
it transforms multiple image links and image references in markdown

@artbycrunk
Copy link
Contributor Author

is this ok to merge?

@pieh pieh changed the title handle imageReference nodes feat(gatsby-remark-images): handle image references Jan 29, 2019
@pieh
Copy link
Contributor

pieh commented Jan 29, 2019

I've added passing alt field from referencing image (it was discarded previously)
@artbycrunk please take a looksy in case you can think if doing it in nicer way (I didn't want to mutate reference node so created this overWrites object)

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

Let's merge this in. We can potentially iterate on implementation in future, there's no reason not to merge and publish.

Thanks @artbycrunk!

@pieh pieh merged commit 9ee6b4a into gatsbyjs:master Jan 30, 2019
@gatsbot
Copy link

gatsbot bot commented Jan 30, 2019

Holy buckets, @artbycrunk — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gatsby-remark-images doesnt handle imageReferences in md files
3 participants