shorten non URL links too

This commit is contained in:
Andrew Pareles 2025-05-10 15:53:05 -07:00
parent ecff59eed7
commit 61fc593903

View file

@ -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)
}