Skip to content

fix: preserve graphassets images during HTML import#136

Merged
borivojevic merged 2 commits into
mainfrom
mirko/bnd-4085-maintain-embedded-images-when-importing-rich-text-from
Dec 12, 2025
Merged

fix: preserve graphassets images during HTML import#136
borivojevic merged 2 commits into
mainfrom
mirko/bnd-4085-maintain-embedded-images-when-importing-rich-text-from

Conversation

@borivojevic

@borivojevic borivojevic commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Summary

  • keep graphassets-hosted img tags as image nodes with handle and attributes
  • leave non-graphassets images as links to avoid unsafe uploads
  • add regression test to cover preserving Hygraph-hosted images during HTML import

@linear

linear Bot commented Dec 11, 2025

Copy link
Copy Markdown

@changeset-bot

changeset-bot Bot commented Dec 11, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7aad5d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphcms/html-to-slate-ast Patch

Not sure what this means? Click here to learn what changesets are.

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

@flexzuu flexzuu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good, I repeat fabis concern and my comment ehere here but i think this should not block the merge. We can deal with this if it ever becomes an issue.

@Jonas Do you think this might cause any issues if I import images from other environments or projects? If it's in the public package that could happen for customers theoretically (edited)

yeah it could lead to not found issues on the project for sure, so ideally we would check if the asset-env-id also matches and maybe even check the asset still exists in the project but on the other hand you may have similar issues with assets that you link without using proper embeds and then go and delete the asset.

This change ensures that graphassets images are preserved when importing HTML.
@borivojevic borivojevic merged commit 4f506a2 into main Dec 12, 2025
3 checks passed
@borivojevic borivojevic deleted the mirko/bnd-4085-maintain-embedded-images-when-importing-rich-text-from branch December 12, 2025 08:05
@github-actions github-actions Bot mentioned this pull request Dec 12, 2025
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.

2 participants