Skip to content

Store links from Markdown import and connected-app writes on the hyperlink mark #335

Description

@HMarzban

Parent

#328. Related: #174

Problem

Markdown import and connected-app writes store links on the old link mark. The pad cannot preview or edit such a link. parseMarkdown uses the export manager (markdownExport.ts). StarterKit's link comes first there, so it claims the Markdown link token.

What to do

In markdownExtensions (markdownExport.ts), move Hyperlink before ...migrationExtensions. @tiptap/markdown picks the first extension that claims a token. The claim order is not documented, so add a comment on the order. Export still serializes stored link marks, so keep link in the set. Do not build a second manager.

Checked with Bun on 2026-09-29: the reorder gives hyperlink, and export output is byte-identical. The reorder sets no title attr. On hyperlink, title is cached preview metadata.

Acceptance

  • parseMarkdown('[Budget](https://example.test/p?id=a)') gives a hyperlink mark with the same href.
  • **[bold](https://a.test)** keeps bold and gets hyperlink.
  • Export of stored link marks is unchanged.
  • A bare URL alone on its line still becomes media.
  • A unit test in markdownImport.test.ts pins the mark name. Prove it by sabotage: undo the reorder, and the test must fail.
  • In the pad, an imported link opens the hyperlink preview, and Edit works.
  • The <a href> bullet in apps/hocuspocus.server/CLAUDE.md §HTTP Modules no longer calls this a known divergence. CHANGELOG.md [Unreleased] has a ### Fixed line.

Out of scope

Rewriting stored link marks. #174. #244.

Activity

  1. added
    bugSomething isn't working
    EditorTiptap & Prosemirror
    on Sep 28, 2026
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

    EditorTiptap & ProsemirrorbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions