Skip to content

Issue with Copying Preview-State Table Strings in Markdown #5698

Closed

Description

@j0hnny0ne

Where did this happen?

Desktop app (macOS)

Version

1.15.0 (1.15.0)

What happened?

When copying a table string in preview state, the pasted Markdown table content appears as '[table]'. However, the table string can be copied normally via the right-click operation.

Steps to reproduce

  1. Open the target document containing a table and switch to preview mode (where the table is rendered visually rather than displayed as raw Markdown code).
  2. Use the mouse to select the entire content of the table in preview state.
  3. Press the system’s default copy shortcut (e.g., Ctrl+C on Windows/Linux, Cmd+C on macOS) to copy the selected table string.
  4. Paste the copied content into a text editor or Markdown-compatible field (e.g., a new document, comment box).
  5. Observe that the pasted content displays as [table] instead of the actual table string.
  6. Return to the preview-state table, right-click on the selected table content, and choose the "Copy" option from the context menu.
  7. Paste the content again—verify that the actual table string is copied correctly.

Logs, screenshots, or recordings

No response

Activity

  1. github-actions commented on Jul 15, 2026

    @github-actions
    Contributor

    Triage findings

    I traced this and the [table] symptom is already fixed on main — the fix just wasn't in the 1.15.0 build you were running.

    Root cause. In preview mode, Cmd/Ctrl+C copies through ProseMirror's clipboard serializer, which delegates to tiptap-markdown@0.9.0. Its built-in table serializer checks isMarkdownSerializable(node) and, when the copied selection isn't a clean header + body GFM table (e.g. selecting the whole table or only body cells), bails to its raw-HTML fallback. With raw HTML disabled it writes the literal string [table] to the clipboard. That's why:

    • Cmd/Ctrl+C produced [table] — it uses the markdown serializer.
    • right-click → Copy worked — that path copies the visible DOM text via window.getSelection().toString(), not the markdown serializer.

    Fix (already in the codebase). apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/ now registers a custom serializeMarkdownTable on the table node's storage.markdown.serialize (createMarkdownExtensions.ts), replacing the [table] fallback with a real GFM table and synthesizing an empty header row for headerless/partial selections. A TableClipboardMarkdown plugin routes each copied selection appropriately (whole-table selection → GFM table, in-cell/partial selection → plain text). This is covered by serializeMarkdownTable.test.ts (14 passing tests), including one that explicitly reproduces this report.

    So this should be resolved in the next release after 1.15.0. If you still see [table] on a build newer than that, please reopen with the exact version and I'll dig into the specific selection type.

  2. Kitenite commented on Jul 15, 2026

    @Kitenite
    Member

    Hey this was recently fixed will be in next release :)

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions