Repository navigation
Open
Labels
Milestone
Description
Problem
A pasted link keeps its long address as its text. Readers then see https://github.com/oven-sh/bun?tab=readme-ov-file#install where oven-sh/bun would do. Many editors swap the address for the page title. docs.plus did not, and the hyperlink extension gave other Tiptap hosts no way to do it.
What was built
Extension (@docs.plus/extension-hyperlink)
- A new
pasteTitle: { fetchTitle, shouldFetch? }option. The host connects it to its own backend. Unset means off, and the package makes no request of its own. - A pasted bare URL becomes a link at once, with the URL as its text. The title replaces it when
fetchTitleanswers. With no answer in 4 s, the URL stays. - The swap is its own undo step: one
Mod-zrestores the URL, underprosemirror-historyand under Yjs.Mod-Shift-vpastes the raw URL. - The engine cleans every title: it strips control and bidi characters, cuts at 120 graphemes, and refuses invisible text and look-alike addresses (Keep look-alike addresses out of pasted link titles #682).
- At most 5 runs per editor. Each run owns one
AbortControllerand one deadline, and destroy ends them all.
docs.plus
- Live pads only. Chat, history and
/editorkeep the URL. Links to other pads keep the URL in this build (Name pasted docs.plus pad links after their pad #680). - Settings › Appearance › Link previews gains "Use page titles for pasted links". It is on by default, stored per browser, and applies only while signed in.
linkPreviewOnis now the one rule for both link-preview switches. - The privacy page says a pasted link goes to our server, like a link preview.
LEGAL_UPDATEDis 4 November 2026. - A file link takes its decoded file name with its format, such as
Q3 Report.pdf(maintainer ruling, 2026-11-04).
Where the code lives
| Part | Files |
|---|---|
| Engine | extensions/extension-hyperlink/src/paste-title/pasteTitle.ts, cleanTitle.ts, types.ts |
Option, storage, onTransaction, onDestroy |
extensions/extension-hyperlink/src/hyperlink.ts |
| Developer guide | extensions/extension-hyperlink/docs/paste-title.md |
| docs.plus resolver | apps/webapp/src/components/TipTap/hyperlinkPopovers/padPasteTitle.ts |
| Pad-only wiring | apps/webapp/src/components/TipTap/TipTap.tsx (pasteTitle: provider ? padPasteTitle : undefined) |
| Switch and the signed-in rule | apps/webapp/src/stores/linkPreviewStore.ts (pasteTitles, linkPreviewOn) |
| Settings row | apps/webapp/src/components/settings/components/AppearanceSection.tsx, SettingsPanelSkeleton.tsx |
| Privacy text | apps/webapp/src/pages/privacy.tsx |
| File-name title | apps/hocuspocus.server/src/modules/link-metadata/domain/stages/htmlScrape.ts (filenameFromUrl) |
| House rules | apps/webapp/CLAUDE.md §Paste title, extensions/extension-hyperlink/AGENTS.md §Paste title |
Commits
5faf3580dfeat(extension-hyperlink): name pasted links after their page7282bd22afeat(webapp): show page titles for links pasted in a pad2ec2130b4fix(link-metadata): decode the file name in a file link title
How to test
- Extension unit tests:
cd extensions/extension-hyperlink && bun test src/paste-title. - Extension Cypress (13 cases, each proved by sabotage):
cd extensions/extension-hyperlink && env -u ELECTRON_RUN_AS_NODE bunx start-server-and-test playground http://127.0.0.1:5173 'bunx cypress run --browser chrome --spec cypress/e2e/paste-title.cy.ts'. - Real-pad undo under y-undo:
apps/webapp/cypress/e2e/document/paste-title.cy.ts. It stays out of CI by maintainer ruling, because it needsmake dev-local. The command is inapps/webapp/CLAUDE.md§Paste title. Run it on every Tiptap or y-tiptap upgrade. - Checked in two browsers on 2026-11-04: the title shows in both tabs, the first undo restores the URL, and the second removes the paste.
Production check, after the deploy
- Open a pad you can edit, for example a new one from
https://docs.plus/new. - Copy
https://github.com/oven-sh/bunand paste it alone into an empty line. - Expected: the link shows the address at once, then reads
oven-sh/bunwithin about a second. - Press ⌘Z: the address comes back. Press ⌘Z again: the paste goes.
- Paste with ⌘⇧V: the address stays, with no title.
- Paste
https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf: it readsdummy.pdf.
If the title never comes, open the browser network panel. Look for GET /api/metadata?url=… on the REST host. A failed or empty reply there points at the link-metadata module, not the editor. Signed in, also check that the Settings switch is on.
Done when
- Built, reviewed and committed.
- Pushed and deployed.
- The production check above passes.
-
@docs.plus/extension-hyperlinkreleased withpasteTitle(see Keep look-alike addresses out of pasted link titles #682 for the release box).
Related: #242 (link hovercard).
Activity
docs: align the link docs with the shipped code
HMarzban commentedon Nov 4, 2026
Status, 2026-11-04. The earlier "not pushed yet" note is out of date. The work is on
mainin4e1aca058, and deploy run41854096960shipped it.Left:
dummy.pdf. The 2026-11-04 check covered steps 2–3.@docs.plus/extension-hyperlink2.3.0 withpasteTitle(release box on Keep look-alike addresses out of pasted link titles #682).