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.
(cherry picked from commit 06174a9cb3
)
Service-Card-Id: 88740699
Service-Version: 1.17
This commit is contained in:
parent
30419b99df
commit
87333f79ed
|
@ -257,6 +257,7 @@ condrv
|
|||
conechokey
|
||||
conemu
|
||||
configurability
|
||||
confusables
|
||||
conhost
|
||||
conime
|
||||
conimeinfo
|
||||
|
|
|
@ -2891,7 +2891,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();
|
||||
|
|
Loading…
Reference in New Issue