# Editing a Markdown document deletes and re-adds its Jira attachment **What you are seeing** An edited document lost its old attachment id, and the issue history shows an attachment deleted and re-added. --- ## Why it happens Editing works by deleting the existing .md attachment and uploading a replacement. There is no in-place update. --- ## What to do Expect this. It is how the app saves. Do not build links against a specific attachment id, and warn watchers that edits produce attachment events. --- ## Settings involved | **Setting** | **Where** | **What it does** | | ------------------------- | ------------ | ------------------------------------------------------------------------------------------ | | View / Edit (editor mode) | Editor modal | Only **Save** in edit mode replaces the attachment. Viewing a document changes nothing. | | Title | Editor modal | Becomes the new attachment's filename, so changing it saves the document under a new name. | --- ## Limits that apply here | **Limit** | **Value** | **What happens** | | ------------------------ | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Document title length | 50 characters | Enforced by the Title input in the editor. The title becomes the attachment filename. | | Large document preview | About 1,000,000 characters | Read-only previews longer than this switch to a virtualised viewer that renders in chunks as you scroll, so browser find-in-page and similar behaviour differ. | | Simultaneous image loads | 20 | At most 20 image URLs are resolved at once, so image-heavy documents load in waves. | --- ## A few things that catch people out * Editing is destructive to Jira's attachment record: the old .md attachment is deleted and a replacement uploaded, so the attachment id, upload date and author all change, watchers see delete-then-add events, and links to the old attachment id break. * If the delete succeeds but the re-upload fails, the document is lost and no error is shown. * Nothing prevents two documents on the same issue having the same title, and renaming makes the old filename disappear. --- ## Related ### [Document disappeared after saving an edit, with no error shown](https://help.gocapable.com/jira-markdown/document-disappeared-after-saving-an-edit-with-no-error-shown.html) When a save deletes the old file but the new one never arrives. ### [Renaming a document made the old one disappear, or two tabs now share the same name](https://help.gocapable.com/jira-markdown/renaming-a-document-made-the-old-one-disappear-or-two-tabs-now-share-the-same-name.html) The title is the filename, so renaming saves a new file. ### [Everything else](https://help.gocapable.com/jira-markdown/everything-else.html) The rest of this family. --- _Found it? Good._