Fix rendering of :doc: links with explicit titles in help text in the terminal
This commit is contained in:
parent
bb33c66570
commit
7b6d11fd1e
@ -91,7 +91,7 @@ for the operating system. Various special values are supported:
|
||||
|
||||
:code:`default`
|
||||
run the default open program. Note that when using the hyperlink :code:`--type`
|
||||
the default is to use the kitty :doc:`/open_actions` facilities.
|
||||
the default is to use the kitty :doc:`hyperlink handling </open_actions>` facilities.
|
||||
|
||||
:code:`launch`
|
||||
run :doc:`/launch` to open the program in a new kitty tab, window, overlay, etc.
|
||||
|
||||
@ -140,11 +140,12 @@ func (self *Context) Prettify(text string) string {
|
||||
return self.ref_hyperlink(val, "envvar-")
|
||||
case "doc":
|
||||
text, target := text_and_target(val)
|
||||
if text == target {
|
||||
target = strings.Trim(target, "/")
|
||||
if title, ok := kitty.DocTitleMap[target]; ok {
|
||||
val = title + " <" + target + ">"
|
||||
}
|
||||
no_title := text == target
|
||||
target = strings.Trim(target, "/")
|
||||
if title, ok := kitty.DocTitleMap[target]; ok && no_title {
|
||||
val = title + " <" + target + ">"
|
||||
} else {
|
||||
val = text + " <" + target + ">"
|
||||
}
|
||||
return self.ref_hyperlink(val, "doc-")
|
||||
case "iss":
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user