You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pasting a link whose text/html label is a shortened form of its URL plants a [ inside the URL #118
When a clipboard carries a URL as text/plain and an anchor labelled with a shortened rendering of that URL as text/html, pasting into a GitHub comment box inserts the Markdown link syntax inside the URL:
That is correct for prose containing a link, where the plaintext is a flattening of the HTML. Here the plaintext is the URL and the label is a substring of it, so the label is found at offset 25 rather than 0 and the splice covers only the tail.
The same corruption happens when prose wraps the URL in punctuation — plaintext (https://github.com/owner/repo/blob/main/a.js#L7) yields (https://github.com/owner/[repo/…#L7](…)).
Who hits it
Any tool that writes a link to the clipboard as "URL as plaintext, shortened label as HTML" — macOS automation scripts (Hammerspoon/Alfred/Keyboard Maestro), clipboard managers, and "copy link" affordances that shorten the visible text. Labels containing a character the URL does not (repo#1234) are unaffected, because indexOf misses and the paste is left alone; every label that is a substring of its own URL is affected.
Proposed fix
#117 — replaces the whole URL when the label is a shortened rendering of it, declines rather than corrupting when the label sits inside a URL that is not its own href, and leaves every other case on the existing path. Four regression tests, all failing before the change.
Activity