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

fix(img): set src properly for magic image blocks #952

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

rafegoldberg
Copy link
Contributor

@rafegoldberg rafegoldberg commented Aug 26, 2024

🎫 Fixes RM-10621

🧰 Changes

  • properly convert the magic block url field to <Image[src]>
  • update legacy RDMD to the latest pre-v7.x release

🧬 QA & Testing

Pull this branch down and try running the new test in the images.test.ts file.

@rafegoldberg rafegoldberg added the refactor Issues about tackling technical debt label Aug 26, 2024
@@ -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;
Copy link
Contributor Author

@rafegoldberg rafegoldberg Aug 26, 2024

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?

Copy link
Collaborator

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.

@rafegoldberg rafegoldberg merged commit 8f71fce into next Aug 26, 2024
13 checks passed
@rafegoldberg rafegoldberg deleted the fix/img/set-src-prop-for-magic-block-images branch August 26, 2024 19:01
rafegoldberg pushed a commit that referenced this pull request Aug 26, 2024
## 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-->
@rafegoldberg
Copy link
Contributor Author

This PR was released!

🚀 Changes included in v7.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues about tackling technical debt released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants