format/htmlparser: keep <> when converting links without text
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run

This commit is contained in:
Tulir Asokan 2025-02-26 22:56:29 +02:00
commit b72caa948c

View file

@ -455,7 +455,7 @@ var MarkdownHTMLParser = &HTMLParser{
PillConverter: DefaultPillConverter,
LinkConverter: func(text, href string, ctx Context) string {
if text == href {
return text
return fmt.Sprintf("<%s>", href)
}
return fmt.Sprintf("[%s](%s)", text, href)
},