When pasting images, there are no files in the attachment. After publishing, the attachment has an extra image file #12377

Closed
opened 2025-11-02 10:07:56 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @seepine on GitHub (Jan 24, 2024).

Description

This seems a bit redundant because when pasting images, the editor has automatically converted it to Markdown image syntax, which can be displayed. And at this point, if I clear the editor content, it means I don't want to display this image, but it will appear in the attachment again.

Gitea Version

1.21.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

c852b748d15e0521a4f8f0113775236c

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

MySQL/MariaDB

Originally created by @seepine on GitHub (Jan 24, 2024). ### Description This seems a bit redundant because when pasting images, the editor has automatically converted it to Markdown image syntax, which can be displayed. And at this point, if I clear the editor content, it means I don't want to display this image, but it will appear in the attachment again. ### Gitea Version 1.21.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots ![c852b748d15e0521a4f8f0113775236c](https://github.com/go-gitea/gitea/assets/93666053/b9202a4c-c129-44f1-8612-98982fa0f4f7) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 10:07:56 -06:00
Author
Owner

@a1012112796 commented on GitHub (Jan 24, 2024):

Yea, But In fact if you past a image on to the markdown editor, That's means two steps, it will push this image onto service as an attachement at first, then will insert a link to this atachement onto the editor. So if you want to remove this image, you had to not only remove the link in markdown content, but also delete pushed atachement manually.I think it's not a bug.

@a1012112796 commented on GitHub (Jan 24, 2024): Yea, But In fact if you past a image on to the markdown editor, That's means two steps, it will push this image onto service as an attachement at first, then will insert a link to this atachement onto the editor. So if you want to remove this image, you had to not only remove the link in markdown content, but also delete pushed atachement manually.I think it's not a bug.
Author
Owner

@seepine commented on GitHub (Jan 24, 2024):

Yea, But In fact if you past a image on to the markdown editor, That's means two steps, it will push this image onto service as an attachement at first, then will insert a link to this atachement onto the editor. So if you want to remove this image, you had to not only remove the link in markdown content, but also delete pushed atachement manually.I think it's not a bug.

I don't think so, this should be automatically processed by the system, such as after submission, traversing whether all uploaded images exist in the markdown, and if they do not exist, automatically deleting them, rather than relying on users to manually process them.

@seepine commented on GitHub (Jan 24, 2024): > Yea, But In fact if you past a image on to the markdown editor, That's means two steps, it will push this image onto service as an attachement at first, then will insert a link to this atachement onto the editor. So if you want to remove this image, you had to not only remove the link in markdown content, but also delete pushed atachement manually.I think it's not a bug. I don't think so, this should be automatically processed by the system, such as after submission, traversing whether all uploaded images exist in the markdown, and if they do not exist, automatically deleting them, rather than relying on users to manually process them.
Author
Owner

@wxiaoguang commented on GitHub (Apr 4, 2025):

Editor change won't change the attachments. That's by-design.

Otherwise, auto-removal will cause more bugs, for example: cut the text with attachment link and paste it to somewhere else.

@wxiaoguang commented on GitHub (Apr 4, 2025): Editor change won't change the attachments. That's by-design. Otherwise, auto-removal will cause more bugs, for example: cut the text with attachment link and paste it to somewhere else.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12377