mirror of
https://github.com/voideditor/void
synced 2026-05-23 09:28:23 +00:00
shorten non URL links too
This commit is contained in:
parent
ecff59eed7
commit
61fc593903
1 changed files with 2 additions and 3 deletions
|
|
@ -137,11 +137,10 @@ const CodespanWithLink = ({ text, rawText, chatMessageLocation }: { text: string
|
|||
|
||||
}
|
||||
|
||||
// If it's a file path, shorten it and add tooltip
|
||||
// If it's a file path, shorten it and add tooltip (whether or not it's a link)
|
||||
let displayText = link?.displayText || text
|
||||
let tooltip: string | undefined = undefined
|
||||
|
||||
if (link?.uri && isValidUri(displayText)) {
|
||||
if (isValidUri(displayText)) {
|
||||
tooltip = getRelative(URI.file(displayText), accessor) // Full path as tooltip
|
||||
displayText = getBasename(displayText)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue