Skip to content

Commit

Permalink
hyperlinks: fix id escape format
Browse files Browse the repository at this point in the history
Commit 43efca7 added support for url IDs within OSC8 escape
sequences, however the formatting of the param is incorrect.

Use `id=` instead of `id:`

Fixes: 43efca7 ("hyperlinks: add support for optional id parameter")
  • Loading branch information
rockorager authored and gdamore committed Oct 17, 2022
1 parent 3aa9ffc commit ede1dd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion style.go
Expand Up @@ -171,6 +171,6 @@ func (s Style) UrlId(id string) Style {
bg: s.bg,
attrs: s.attrs,
url: s.url,
urlId: "id:" + id,
urlId: "id=" + id,
}
}
4 changes: 2 additions & 2 deletions terminfo/terminfo_test.go
Expand Up @@ -139,8 +139,8 @@ func TestStringParameter(t *testing.T) {
if s != "\x1b]8;;https://example.org/test\x1b\\" {
t.Errorf("Result string failed: %s", s)
}
s = ti.TParm(ti.EnterUrl, "https://example.org/test", "id:1234")
if s != "\x1b]8;id:1234;https://example.org/test\x1b\\" {
s = ti.TParm(ti.EnterUrl, "https://example.org/test", "id=1234")
if s != "\x1b]8;id=1234;https://example.org/test\x1b\\" {
t.Errorf("Result string failed: %s", s)
}
}
Expand Down

0 comments on commit ede1dd5

Please sign in to comment.