Skip to content

Draft migration over-strips: stripDraftMediaUrls removes authored prose URLs, not just leftover lines #344

Description

@dmnyc

From the review of #341.

stripDraftMediaUrls (composer-core.js) removes every occurrence of each attachment URL from the saved text. That is right for the old-format migration (a URL the old composer wrote in as its own line) but wrong for prose a user deliberately authored: "mirror at https://x/a.png if the first dies" silently loses the URL on the next restore if that image is also attached.

Fix shape: strip only occurrences that sit on a line boundary — alone on the line, or glued to either end — which is exactly the rule the paste-offer already uses (urlOnBoundary, same file). Interior mentions stay. Vectors: lone line stripped, glued-end stripped, mid-sentence kept, and a URL that appears both as a leftover line and inside prose keeps only the prose copy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions