Skip to content

Render Markdown links without duplicate destinations #76

Description

@mochow13

Problem

The REPL's Markdown renderer prints both a link's label and destination. For example:

[internal/cli/repl/repl.go:413](/internal/cli/repl/repl.go#L413)

is displayed with the source location followed by the duplicate target path.

Desired behavior

  • Relative repository source references and anchors should display their label only.
  • External http and https links should remain clickable in terminals that support OSC 8 hyperlinks, without printing a duplicate destination.
  • Bare URLs should retain their current behavior.

Suggested approach

Update the REPL Markdown rendering layer to classify Markdown link destinations before rendering:

Destination Rendering
Relative path or #anchor Display label only
http:// or https:// Render label as an OSC 8 terminal hyperlink

Avoid a broad regex replacement that would strip or break ordinary external links. Add focused tests for a relative source reference and an external URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions