Replace Image Feature - #363
Merged
Merged
Conversation
saa938
requested changes
Aug 8, 2026
saa938
left a comment
Collaborator
There was a problem hiding this comment.
fix merge conflicts and also i think alt text and caption are the same here. i looked it up and they are different, can you add alt text, display it in the dialog, allow editing it, and warn if there isn't that much alt text.
saa938
requested changes
Aug 11, 2026
saa938
previously approved these changes
Aug 12, 2026
saa938
left a comment
Collaborator
There was a problem hiding this comment.
good ima fix one thing rq before i merge it
The base @editorjs/image `set data()` accessor copies only `file`, `caption`,
and its three built-in tunes into `_data`, so every custom key is dropped when
a block is constructed. The constructor already restores `altText` and
`richCaption` for this reason; `centerImage` was left out.
Because `blocks.update()` composes a new block from `Object.assign({},
await block.data, patch)`, it round-trips through `save()` and the
constructor — so replacing an image reset centering to false, contradicting
the replace dialog's promise that styling is kept. Reopening an article lost
the setting the same way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This allows people to replace images
Resolves #335
Pull request type
Checklist