Skip to content

Replace Image Feature - #363

Merged
saa938 merged 11 commits into
AP-Students:mainfrom
Famousmaster206:replace-image
Aug 12, 2026
Merged

Replace Image Feature#363
saa938 merged 11 commits into
AP-Students:mainfrom
Famousmaster206:replace-image

Conversation

@Famousmaster206

@Famousmaster206 Famousmaster206 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This allows people to replace images
Resolves #335

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code

@saa938 saa938 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment thread src/components/article-creator/Editor.tsx Outdated
Comment thread src/components/article-creator/Editor.tsx
Comment thread src/components/article-creator/Editor.tsx
saa938
saa938 previously approved these changes Aug 12, 2026

@saa938 saa938 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.
@saa938
saa938 merged commit e8f6ecd into AP-Students:main Aug 12, 2026
1 check passed
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.

Replace Image Option

2 participants