Repository navigation
Releases
v2.0.1
Changelog
Bug fixes
- 975a0f3: fix: close wrap writer before its downstream chain (#575) (@taciturnaxolotl)
Other work
- c293649: chore: fix pre-existing lint failures (#575) (@taciturnaxolotl)
- 95c93db: chore: bump lipgloss to v2.0.4 (@taciturnaxolotl)
- 600b93a: chore: remove CODEOWNERS (@aymanbagabas)
- 253da61: fix(ci): use local golangci config (@aymanbagabas)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v2.0.0
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 automaticallyThis 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!
- c84017c: feat(ansi): add hyperlink support (@aymanbagabas)
Fixed
- 087c9c6: fix(ansi): handle multi-byte UTF-8 characters correctly in margin writers (@Gustave-241021)
- df61d8e: fix(ansi): remove unused overline style (@aymanbagabas)
- ffb4696: fix(gen): style generator: use absolute path for output files (@aymanbagabas)
- 510d0f0: fix(table): ensure document background color applies to table as well (#431) (@andreynering)
- c0a9b8d: fix(v2): import path /v2 (#412) (@caarlos0)
- 5a82082: fix: hide mailto: prefix in rendered email links (@Gustave-241021)
Docs
- 5f3f7be: docs: add v2 upgrade guide + release notes (#509) (@aymanbagabas)
- d1c81b3: docs: remove WithAutoStyle in README and examples (@meowgorithm)
- 86f90cf: docs: update README with v2 import paths and color downsampling example (@aymanbagabas)
Other stuff
- 4c9b764: perf(ansi): ensure all PenWriter instances are closed (#465) (@tazjin)
- f8f160e: refactor!: migrate to lipgloss v2 (@aymanbagabas)
- 9f9007e: refactor(ansi): drop reflow and use cellbuf.Wrap (@aymanbagabas)
- 69649f9: refactor: migrate to charm.land module path (#489) (@aymanbagabas)
- cd9a02a: refactor: remove auto style and make dark the default (@aymanbagabas)
- 800eb81: 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.
Charmηη±εΌζΊ β’ Charm loves open source
v0.10.0
Actually readable tables
Big tables that included links were always hard to read. Links can be very long, and tables often have limited space to render them. This means that links often took the space of many lines and weren't properly clickable because they were being truncated in practice.
Starting on this release, Glamour will render links and images at the footer of the table, with a reference number so you can easily find the link you're looking for. If you want the old behavior, it is still supported via the new WithInlineTableLinks option.
The New Way
The Old Way
Wanna render tables with inline links? You still can:
r, err := glamour.NewTermRenderer(glamour.WithInlineTableLinks(true))
if err != nil { /*...*/ }
out, err := r.RenderBytes(in)
if err != nil { /*...*/ }
fmt.Fprintf(os.Stdout, "%s\n", out)Prettier GitHub links
We also introduced a change so that GitHub links inside tables that reference issues, discussions or PRs will be shown in its shortened form, similar to how GitHub itself present the links on issue descriptions: owner/repo#123.
Extra
Also, we introduced WithTableWrap, so you can disable table text wrapping if really want:
r, err := glamour.NewTermRenderer(glamour.WithTableWrap(false))
if err != nil { ... }
out, err := r.RenderBytes(in)
if err != nil { ... }
fmt.Fprintf(os.Stdout, "%s\n", out)Changelog
New Features
- 61cfc45: feat(table): add ability to render links at the bottom (@andreynering)
- 9d87373: feat(table): pad position on table link list (@andreynering)
- 42f47a2: feat(table): prefix all links with the position in the footer (@andreynering)
- a11e9a0: feat(table): show position of link also inside the table (@andreynering)
- 549f544: feat(table): update lipgloss + add
WithTableWrapsetting (@andreynering) - c9af045: feat(tables): format github links inside tables in a more readable manner (@andreynering)
- f2eb484: feat: add autolink package with patterns for more readable github urls (@andreynering)
Bug fixes
- 61ff598: fix(links): fix regression of auto links rendering twice (#415) (@andreynering)
- 6c48e09: fix: address linting issues after golangci-lint v2 update (@andreynering)
- 5437e4a: fix: ensure that prop is always cleared (@andreynering)
Other work
- 6b09916: ci: sync golangci-lint config (#414) (@github-actions[bot])
- 9dfd865: lint: fix linting for unused parameter (@andreynering)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.9.1
Some users were reporting occasional checksum miss matches when building using Glamour v0.9.0.
This release provides a new tag to hopefully fix this.
Changelog
Other work
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.9.0
Better Syntax Highlighting, Better Tables
It's totally time for a Glamour release right? This release features a nice lil' contribution from the @github CLI team and pulls in some big table improvements from Lip Gloss upstream. Let's go!
Specifying Chroma Styles
Thanks to valiant efforts of @andyfeller and @williammartin at @github, you can now use glamour.WithChromaFormatter to specify an exact Chroma style to use, independent of the higher level style.
myHotOps := glamour.WithOptions(
glamour.WithChromaFormatter("terminal16"),
glamour.WithStandardStyle("dark"),
)As a bonus, you can also use glamour.WithOptions as a meta layer for grouping options.
Better Tables
This release also reaps the benefits from the table rendering overhaul in Lip Gloss v1.1.0! Glamour will now be much smarter when it comes to deciding column widths, and the content will now wrap appropriately instead of just being cut when it won't fit.
Changelog
New Features
- 4c040b7: feat: add term renderer option for chroma formatter (#395) (@williammartin)
- 39de448: feat(ci): use goreleaser (#348) (@aymanbagabas)
Bug fixes
- f43b1ad: fix(tables): pin lipgloss to v1.1.0 for table improvements; update tests (#394) (@andreynering)
- bdc4ec5: fix(table): fix rendering table in ascii-only mode (#393) (@andreynering)
- 9cedaca: fix: render right margin for block stack elements (#334) (@jahvon)
Documentation updates
- f29dc10: docs(example): update example to demonstrate color downsampling (@meowgorithm)
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.8.0
Fixing (almost) everything
With a ton of rendering fixes, she's sparkling β¨
It has that new car smell...
So many fixesβ¦one man
@caarlos0 fixed a whopping 15 issues with PR #317 π₯
- Fix URL links not rendering inside bold text #312
- Fix autolink element rendering #290
- Add support for backslash escapes #106
- Fix cases when backslash should not be shown #274
- Fix escape character rendering #311
- Fix newlines in definition lists #239
- Fix nested blockquotes rendering #313
- Fix block quote accidentally combining lines #237
- Fix document-level indent causing unintended wrapping after quoted lines #68
Better tables
Tables now provide stable rendering of elements within the table including alignment, text styles, all that jazz. It now uses the lipgloss table, making it much more consistent across the board.
- Render tables with Lip Gloss #262
- Refactor to replace
TableWriterwith Lip Gloss table #254 - Fix inline code within table #315
- Fix links in tables #316
- Provide consistent alignment of table elements #60
- Support alignment in tables #117
New! Tokyo Night
The markdown rendererβs equivalent of a mani-pedi π
Tokyo Night is now a built-in style for Glamour. This means you'll be able to use it in the next release of Glow.
glow -s "tokyo-night"
# OR
export GLAMOUR_STYLE="tokyo-night"Check out the custom style example to learn how to support custom styles in your own Glamour apps.
- feat: Add Tokyo Night theme by @basilioss in #229
No TTY?
Glamour will now check if stdout is a tty and will strip styles when it is not.
Other Stuff
- CI: scan for vulnerabilities and common errors by @caarlos0 in #310
- Use freeze for gallery images by @bashbunni in #322
New Contributors
- @bashbunni made their first contribution in #322
Full Changelog: v0.7.0...v0.8.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
This discussion was created from the release v0.8.0.
v0.7.0
Fixes βnβ Things
Fixed
- Render URLs in table by @brianstrauch in #248
- Align GitHub flavoured Tables by @maaslalani in #284
Changes
- feat: use (exported) consts for default styles by @meowgorithm in #232
- Bump github.com/alecthomas/chroma/v2 from 2.7.0 to 2.8.0 by @dependabot in #243
New Contributors
- @garymh made their first contribution in #222
- @Benicas made their first contribution in #251
- @brianstrauch made their first contribution in #248
Full Changelog: v0.6.0...v0.7.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.6.0
Pink theme and general maintenance
Fixed
- Do not replace comments with empty lines by @caarlos0 in #142
- Register chroma style once by @aymanbagabas in #156
Added
- Add
pinktheme by @maaslalani in #159
Changes
- Bump github.com/muesli/termenv to 0.13.0
- Bump github.com/yuin/goldmark to 1.5.2
- Bump github.com/microcosm-cc/bluemonday to 1.0.21
New Contributors
- @caarlos0 made their first contribution in #143
- @otherJL0 made their first contribution in #160
- @aymanbagabas made their first contribution in #156
- @maaslalani made their first contribution in #159
- @mmrwoods made their first contribution in #162
- @jolheiser made their first contribution in #197
Full Changelog: v0.5.0...v0.6.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.
v0.5.0
Hello, Dracula
Added
- Ship with built-in Dracula color scheme (#137)
package main
import (
"fmt"
"github.com/charmbracelet/glamour"
)
func main() {
in := "# Hello World\n\nThis is a simple example of Markdown rendering with Glamour!"
out, _ := glamour.Render(in, "dracula")
fmt.Println(out)
}



