-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix(img): set src properly for magic image blocks #952
fix(img): set src properly for magic image blocks #952
Conversation
@@ -40,6 +40,8 @@ const readmeToMdx = (): Transform => tree => { | |||
|
|||
visit(tree, 'image', (image, index, parent) => { | |||
if (!('data' in image)) return; | |||
|
|||
if ('url' in image) image.data.hProperties.src = image.url; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the "meat" of the solution. Honestly, I don't love having to do this here, since it feels to me like this should be happening in the imageTransformer
? or am I misunderstanding the Unified order-of-ops here, or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it seems like there might be some duplication of code. But this seems for now.
## Version 7.3.0 ### ✨ New & Improved * add downstream styles ([#953](#953)) ([0b1b52d](0b1b52d)) ### 🛠 Fixes & Updates * **img:** set src properly for magic image blocks ([#952](#952)) ([8f71fce](8f71fce)), closes [/github.com//pull/952/files#diff-9b10647639421f1135101ae63ca87780ab63af9e81c8da0b00ea6d0ddd08b8b6R26-R50](https://github.com/readmeio//github.com/readmeio/markdown/pull/952/files/issues/diff-9b10647639421f1135101ae63ca87780ab63af9e81c8da0b00ea6d0ddd08b8b6R26-R50) <!--SKIP CI-->
This PR was released!🚀 Changes included in v7.3.0 |
🧰 Changes
url
field to<Image[src]>
🧬 QA & Testing
Pull this branch down and try running the new test in the
images.test.ts
file.