mirror of
https://github.com/walles/moar.git
synced 2024-11-22 21:50:43 +03:00
14c2351e53
Before this change, if you had a hyperlink followed by unstyled text, moar wouldn't reset the hyperlink property, messing up everything after it. With this change in place, that now works as one would expect. Fixes #169.
18 lines
300 B
Go
18 lines
300 B
Go
package twin
|
||
|
||
import (
|
||
"strings"
|
||
"testing"
|
||
|
||
"gotest.tools/v3/assert"
|
||
)
|
||
|
||
func TestHyperlinkToNormal(t *testing.T) {
|
||
url := "http://example.com"
|
||
|
||
style := StyleDefault.WithHyperlink(&url)
|
||
assert.Equal(t,
|
||
strings.ReplaceAll(StyleDefault.RenderUpdateFrom(style), "", "ESC"),
|
||
"ESC]8;;ESC\\")
|
||
}
|