Skip to content

fix(deps): update module github.com/charmbracelet/glamour to v2#188

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/github.com-charmbracelet-glamour-2.x
Open

fix(deps): update module github.com/charmbracelet/glamour to v2#188
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/github.com-charmbracelet-glamour-2.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 9, 2026

This PR contains the following updates:

Package Change Age Confidence
github.com/charmbracelet/glamour v0.10.0v2.0.0 age confidence

Release Notes

charmbracelet/glamour (github.com/charmbracelet/glamour)

v2.0.0

Compare Source

What's New in Glamour v2

We're excited to announce the second major release of Glamour!

If you (or your LLM) are just looking for technical details on migrating from v1, please check out the Upgrade Guide.

[!NOTE]
We don't take API changes lightly and strive to make the upgrade process as simple as possible. We believe these changes bring necessary improvements and pave the way for the future. If something feels way off, let us know.

❤️ Charm Land Import Path

We've updated our import paths to use vanity domains and use our domain to import Go packages.

// Before
import "github.com/charmbracelet/glamour"

// After
import "charm.land/glamour/v2"

💄 Lip Gloss v2 Integration

Glamour v2 now uses Lip Gloss v2 under the hood, bringing improved performance and more consistent styling across the Charm ecosystem.

Since Glamour is designed to be pure (same input = same output), it doesn't peek at your terminal's capabilities. Instead, color downsampling is handled explicitly via Lip Gloss when you're ready to render:

r, _ := glamour.NewTermRenderer(glamour.WithWordWrap(80))
out, _ := r.Render(markdown)

// Downsample colors based on terminal capabilities
lipgloss.Print(out)

No more I/O fights between Glamour and Lip Gloss. Glamour focuses on rendering, Lip Gloss handles the colors. Everyone's happy!

🌏 Better Text Wrapping

Text wrapping has been rewritten using lipgloss.Wrap, which means way better handling of:

  • Multi-byte UTF-8 characters (CJK, emojis, etc.)
  • Complex Unicode sequences
  • Terminal cell width edge cases

Your Japanese documentation, emoji-filled READMEs, and creative Unicode art will all render beautifully now.

🔗 Hyperlink Support

Glamour now supports ANSI hyperlinks! If your terminal supports OSC 8 (and many modern terminals do), your links can be clickable. No changes needed, it just works.

md := `Check out [Charm](https://charm.sh) for more awesome tools!`
out, _ := glamour.Render(md, "dark")
fmt.Print(out)
// In supporting terminals, "Charm" will be clickable!
Which terminals support OSC 8 hyperlinks?

📧 Cleaner Email Rendering

Email autolinks now hide the mailto: prefix for a cleaner look while remaining functional. Because nobody wants to read mailto: in their rendered markdown.

// Before (v1): Rendered as "mailto:hello@charm.sh"
md := `Contact us at <hello@charm.sh>`
out, _ := glamour.Render(md, "dark")
// Output: mailto:hello@charm.sh (ugly!)

// After (v2): Rendered as just "hello@charm.sh"
md := `Contact us at <hello@charm.sh>`
out, _ := glamour.Render(md, "dark")
// Output: hello@charm.sh (much better!)

🌙 Dark is the New Default

The WithAutoStyle() option and AutoStyle have been removed. The default style is now "dark", which works well across most terminals. You can still explicitly choose any style:

// Use a specific style
out, _ := glamour.Render(markdown, "light")
out, _ := glamour.Render(markdown, "pink")
out, _ := glamour.Render(markdown, "dracula")
out, _ := glamour.Render(markdown, "tokyo-night")

Simpler is better!

🎨 Color Profile Changes

The WithColorProfile() option has been removed. Color adaptation is now handled by Lip Gloss when rendering output:

// Old approach (v1)
r, _ := glamour.NewTermRenderer(
    glamour.WithColorProfile(termenv.TrueColor),
)

// New approach (v2)
r, _ := glamour.NewTermRenderer(glamour.WithWordWrap(80))
out, _ := r.Render(markdown)
lipgloss.Print(out) // Handles color downsampling automatically

This separation of concerns makes Glamour's rendering more predictable and testable.

👋 Farewell, Overline

The Overlined field has been removed from all style primitives. It was rarely used and not widely supported across terminals. If you need similar visual separation, consider using underline, bold, or background colors instead.

🐛 Bug Fixes

  • Fixed CJK character rendering in margin writers
  • Fixed table background colors to match document styling
  • Improved handling of edge cases in text wrapping
  • Better handling of code spans with special characters

🌈 More on Glamour v2

Ready to migrate? Head over to the Upgrade Guide for the full migration checklist.


Changelog

New!
  • c84017c97575bf30267a367c4174f0b24b0347d1: feat(ansi): add hyperlink support (@​aymanbagabas)
Fixed
  • 087c9c64f7f609f19fa65dfa402410216ce30a85: fix(ansi): handle multi-byte UTF-8 characters correctly in margin writers (@​Gustave-241021)
  • df61d8ef25f4b202c9354cbea96f1fe2cb033725: fix(ansi): remove unused overline style (@​aymanbagabas)
  • ffb4696ed9f26c7725a8df99a1cdec615da214fa: fix(gen): style generator: use absolute path for output files (@​aymanbagabas)
  • 510d0f0fc9a8a48d03f40ff10f593346a7920905: fix(table): ensure document background color applies to table as well (#​431) (@​andreynering)
  • c0a9b8dab67213e624c0cd3bf8e6c1e4fa43dcad: fix(v2): import path /v2 (#​412) (@​caarlos0)
  • 5a8208220018be163aa17cf24554324bdb792e78: fix: hide mailto: prefix in rendered email links (@​Gustave-241021)
Docs
  • 5f3f7bee988785344390ada44344b49d16cdd33d: docs: add v2 upgrade guide + release notes (#​509) (@​aymanbagabas)
  • d1c81b3f0e972d565bbfa397e28ef4cd21732054: docs: remove WithAutoStyle in README and examples (@​meowgorithm)
  • 86f90cfe96d13d4f7fa42dca9088aa7a4dad8b43: docs: update README with v2 import paths and color downsampling example (@​aymanbagabas)
Other stuff
  • 4c9b764d46d8a9a52195bb3a98c968fdb474a09b: perf(ansi): ensure all PenWriter instances are closed (#​465) (@​tazjin)
  • f8f160e6cd7bdf8a3608b47bac64174e7ab0da15: refactor!: migrate to lipgloss v2 (@​aymanbagabas)
  • 9f9007e34076a7929769e319743e0e2f92ee5c8b: refactor(ansi): drop reflow and use cellbuf.Wrap (@​aymanbagabas)
  • 69649f93d3b1d234ee0c89b1e8f14808647fe209: refactor: migrate to charm.land module path (#​489) (@​aymanbagabas)
  • cd9a02a87169d14ef83a1f58eac5a7494b1b2c9d: refactor: remove auto style and make dark the default (@​aymanbagabas)
  • 800eb8175930e2d7ef8f1602c33cd64f96ed7401: refactor: use lipgloss wrap, nbsp for codespan, new uv api, and update testdata (@​aymanbagabas)

Feedback

Have thoughts on Glamour v2? We'd love to hear about it. Let us know on…


Part of Charm.

The Charm logo

Charm热爱开源 • Charm loves open source

v1.0.0

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Contributor Author

renovate bot commented Mar 9, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: go.sum
Command failed: go get -t ./...
go: module github.com/charmbracelet/glamour/v2@v2.0.0 requires go >= 1.25.8; switching to go1.25.8
go: downloading go1.25.8 (linux/amd64)
go: github.com/charmbracelet/glamour/v2@v2.0.0: parsing go.mod:
	module declares its path as: charm.land/glamour/v2
	        but was required as: github.com/charmbracelet/glamour/v2

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.

0 participants