Skip to content

Copy-pasting mentions (embed links) between documents does not work#649

Open
GaboHBeaumont wants to merge 1 commit into
mainfrom
issue-647-copy-pasting-mentions-embed-links
Open

Copy-pasting mentions (embed links) between documents does not work#649
GaboHBeaumont wants to merge 1 commit into
mainfrom
issue-647-copy-pasting-mentions-embed-links

Conversation

@GaboHBeaumont
Copy link
Copy Markdown
Collaborator

Yes — you’re right. If the copied thing is a mention / inline embed, paste should recreate a mention / inline embed, not show raw hm:// links or ask via the “Insert as” menu.

What was happening:

A copied mention is represented in HTML as an anchor like:
Avatar options

But a normal link is also an anchor:
Avatar options

The generic link parser could claim the anchor before the inline-embed parser did, so the paste degraded into regular links / raw hm:// text.
I fixed that by:

giving a[data-inline-embed] parse rules higher priority
making the generic link parser explicitly ignore data-inline-embed anchors
keeping the prior clipboard serialization fixes so re-copying mentions still works

Copy link
Copy Markdown
Collaborator

@iskaktoltay iskaktoltay left a comment

Choose a reason for hiding this comment

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

Why are there so many changed files? I have no idea what to look for. I believe it's not rebased cc. @horacioh

@GaboHBeaumont GaboHBeaumont force-pushed the issue-647-copy-pasting-mentions-embed-links branch from 6a9d267 to cf60d98 Compare May 21, 2026 07:46
@GaboHBeaumont
Copy link
Copy Markdown
Collaborator Author

@iskaktoltay

I fix the commit, but now I realized that the AI messed Inline Embeds versus Mentions.

How do we differentiate between Inline Embeds and Mentions? We agreed that Mentions are strictly for mentioning People.

@horacioh @ericvicenti

@horacioh
Copy link
Copy Markdown
Collaborator

Inline embeds and mentions in the code should be treated the same. we should not have two different types for the same thing

We can treat them differently in the UI, but in the permanent data should be the same

@GaboHBeaumont @iskaktoltay

@horacioh
Copy link
Copy Markdown
Collaborator

@GaboHBeaumont You need to rebase your branch before you create the PR because if you don't rebase, you will include all the other code in your PR. so please rebase your branch first before pushing

Copy link
Copy Markdown
Collaborator

@horacioh horacioh left a comment

Choose a reason for hiding this comment

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

Please rebase your branch first before we accept this PR.

@GaboHBeaumont GaboHBeaumont force-pushed the issue-647-copy-pasting-mentions-embed-links branch from cf60d98 to 35a794d Compare May 21, 2026 09:15
@GaboHBeaumont
Copy link
Copy Markdown
Collaborator Author

Fixed now:

  • rebased the branch onto current main
  • force-pushed a clean history with a single commit
  • narrowed the PR to only the inline-embed copy/paste fix (10 editor files)
  • kept mentions / inline embeds as the same underlying type in code and data

Current head: 35a794dce (fix(editor): preserve inline embeds across copy-paste)

Could you please take another look?

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.

3 participants