Skip to content

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

Closed

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
    bug
    Editor
    on Sep 28, 2026
  2. modified the milestones: v2.4.0, v2.3.0 on Oct 24, 2026
  3. HMarzban commented on Oct 24, 2026

    @HMarzban
    CollaboratorAuthor

    Part of #606, which owns the goal that every extension feature survives Markdown. Milestone v2.3.0 (maintainer, 2026-10-24).

  4. HMarzban commented on Oct 25, 2026

    @HMarzban
    CollaboratorAuthor

    Built and committed on local main. Awaits the maintainer's final push.

    Remaining gate: the backend deploy.

  5. HMarzban commented on Nov 3, 2026

    @HMarzban
    CollaboratorAuthor

    Shipped in 23fde812c. Markdown import and connected-app writes now store links on the hyperlink mark, so the pad can preview and edit them. Stored link marks still export, and the export output is byte-identical. Follow-up cleanups are in 5cfcc023d and 9eb5be842.

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

    Editorbug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions