Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Plain" link regression #347

Open
polds opened this issue Sep 8, 2024 · 1 comment
Open

"Plain" link regression #347

polds opened this issue Sep 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@polds
Copy link

polds commented Sep 8, 2024

Describe the bug
From #19 it seems like links that are "plain" (reference themselves) was fixed to only print the url once. This no longer seems to be the case and doubly prints plain links.

ie: https://www.example.com => https://www.example.com https://www.example.com

This issue is not present in Glamour v0.7.0 but is in Glamour v0.8.0

Setup

  • OS: macOS 14.6.1 (23G93)
  • Shell: zsh 5.9 (x86_64-apple-darwin23.0)
  • Terminal Emulator: Warp, Intellij
  • Terminal Multiplexer: None
  • Glamour: v0.8.0

To Reproduce
Steps to reproduce the behavior:

  1. go get github.com/charmbracelet/[email protected]
  2. Use below snippet as main.go
  3. go run main.go

Source Code

package main

import (
	"fmt"
	
	"github.com/charmbracelet/glamour"
)

func main() {
	md, err := glamour.Render("https://www.example.com", "dark")
	if err != nil {
		fmt.Printf("Error: %v\n", err)
		return
	}
	fmt.Println(md)
}

https://play.golang.com/p/3mfQERFnZ3e (Note: Usually doesn't work due to timeouts importing Glamour)

Expected behavior
From the above example I expect that https://www.example.com is written exactly once.

Screenshots
image

Additional context
#19 references commit 9b192ba but I'm presently having a difficult time finding that commit, I'm still looking.

@polds polds changed the title Potential "Plain" link Regression "Plain" link regression Sep 8, 2024
@polds
Copy link
Author

polds commented Sep 9, 2024

Looks like the change in behavior was introduced in 5f5965e#diff-ea3fd9921125a5b147d806d777214ac9493e6aaeead982dce3e518cf83df1308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants