mirror of
https://github.com/microsoft/terminal.git
synced 2026-02-04 05:35:20 +00:00
Format URLs for display when we show the tooltip (#15095)
This will reduce the incidence of confusables, RTL, and non-printables messing with the display of the URL.
This commit is contained in:
1
.github/actions/spelling/expect/expect.txt
vendored
1
.github/actions/spelling/expect/expect.txt
vendored
@@ -257,6 +257,7 @@ condrv
|
||||
conechokey
|
||||
conemu
|
||||
configurability
|
||||
confusables
|
||||
conhost
|
||||
conime
|
||||
conimeinfo
|
||||
|
||||
@@ -3016,7 +3016,19 @@ namespace winrt::Microsoft::Terminal::Control::implementation
|
||||
auto lastHoveredCell = _core.HoveredCell();
|
||||
if (lastHoveredCell)
|
||||
{
|
||||
const auto uriText = _core.HoveredUriText();
|
||||
winrt::hstring uriText = _core.HoveredUriText();
|
||||
try
|
||||
{
|
||||
// DisplayUri will filter out non-printable characters and confusables.
|
||||
Windows::Foundation::Uri parsedUri{ uriText };
|
||||
uriText = parsedUri.DisplayUri();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_CAUGHT_EXCEPTION();
|
||||
uriText = {};
|
||||
}
|
||||
|
||||
if (!uriText.empty())
|
||||
{
|
||||
const auto panel = SwapChainPanel();
|
||||
|
||||
Reference in New Issue
Block a user