Skip to content

Conversation

@majiayu000
Copy link

Fixes #645

Changes

  • Vendor glamour library with fix for Link.Conceal style property
  • When conceal: true is set in custom style's link element, the URL portion is now hidden
  • Adds check for Styles.Link.Conceal in both regular links and auto-links to set SkipHref = true

This fixes issue charmbracelet#645 where setting `conceal: true` on the `link` element
in a custom style JSON file did not hide the URL portion of links.

The fix is implemented in the glamour library (included as _glamour) by
modifying the link element creation in elements.go to check the
Link.Conceal style property and set SkipHref accordingly.

When Link.Conceal is true, only the link text is rendered without the URL.

Example custom style:
```json
{
  "link": {
    "conceal": true
  }
}
```

Note: This includes a patched copy of glamour. Once the fix is merged
upstream to charmbracelet/glamour, the _glamour directory can be removed
and the replace directive in go.mod updated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: majiayu000 <[email protected]>
@majiayu000 majiayu000 requested a review from a team as a code owner December 30, 2025 18:27
@majiayu000 majiayu000 requested review from kujtimiihoxha and tauraamui and removed request for a team December 30, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using a custom style with conceal:true does not hide element

1 participant