mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-03 22:25:57 +00:00
Use Once for CachedHostname
This commit is contained in:
parent
e6662e11c3
commit
5b160ea599
2 changed files with 8 additions and 12 deletions
|
|
@ -96,7 +96,7 @@ func (self *Context) hyperlink_for_path(path string, text string) string {
|
|||
if err == nil && fi.IsDir() {
|
||||
path = strings.TrimSuffix(path, "/") + "/"
|
||||
}
|
||||
host := utils.CachedHostname()
|
||||
host := utils.Hostname()
|
||||
url := "file://" + host + path
|
||||
return self.hyperlink_for_url(url, text)
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ func (self *Context) link(x string) string {
|
|||
|
||||
func (self *Context) ref_hyperlink(x string, prefix string) string {
|
||||
text, target := text_and_target(x)
|
||||
url := "kitty+doc://" + utils.CachedHostname() + "/#ref=" + prefix + target
|
||||
url := "kitty+doc://" + utils.Hostname() + "/#ref=" + prefix + target
|
||||
text = replace_all_rst_roles(text, func(group rst_format_match) string {
|
||||
return group.payload
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue