rich-text icon indicating copy to clipboard operation
rich-text copied to clipboard

Fixes #91 Rendering images as "image" instead of "link"

Open ai-slave opened this issue 2 years ago • 3 comments

Fixes weird behaviour of importing images as text links instead of images.

ai-slave avatar Jul 29 '22 23:07 ai-slave

⚠️ No Changeset found

Latest commit: c50f1694ab2d35eb658fdb00ca0ca49ad985669a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jul 29 '22 23:07 changeset-bot[bot]

Hey @ndrozd! Thanks for opening the PR, I just wanted to add some context also for the reviewers from our side.

We convert images from any HTML source to a link because the html-to-ast plugin can't upload images from other sources, and our image object in the AST typically is meant to be used with images that are uploaded into Hygraph. So we wanted to avoid writing assets from other places into the AST.

In your case, you would first need to go through the source HTML, find all images, upload them to Hygraph and replace the source URLs with the ones from us. Then you can use your method 👍

We will need to check on our end how can make this clearer and how to better communicate it within the package.

belazer avatar Aug 05 '22 15:08 belazer

Thank you! That's exactly what's happening on my side before converting stuff to AST. All the image srcs are pointing to Hygraph.

ai-slave avatar Aug 05 '22 15:08 ai-slave