Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions apps/desktop/src/ui/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,25 @@ const components: Components = {
const ref = parseInlineRef(text);
if (ref)
return (
<button
type="button"
// Inline like body `code` and the same size, so a file reference sits in the line the way
// code does: a <button> is an inline block, and its padding would raise the line around it.
<span
role="link"
tabIndex={0}
title={`Open ${ref.path}${ref.line ? ` at line ${ref.line}` : ""}`}
onClick={() => openRef(ref)}
className={cx(PILL, "cursor-pointer bg-accent/10 text-accent hover:bg-accent/20")}
onKeyDown={(e) => {
if (e.key !== "Enter" && e.key !== " ") return;
e.preventDefault();
openRef(ref);
}}
className={cx(
PILL,
"cursor-pointer bg-accent/10 font-mono text-[0.85em] text-accent [box-decoration-break:clone] hover:bg-accent/20",
)}
>
<code className="font-mono text-[0.9em]">{children}</code>
</button>
{children}
</span>
);
return (
// The text is on the clipboard, so the press is the code's own and not what holds it (a
Expand Down
Loading