seek indicator for miniview & s char after secured links fixed
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using MyToolkit.Multimedia;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI;
|
||||
@@ -56,20 +57,24 @@ namespace FoxTube
|
||||
Regex regx = new Regex(@"(http(s)?://[\S]+|www.[\S]+|[\S]+@[\S]+)", RegexOptions.IgnoreCase);
|
||||
Regex isWWW = new Regex(@"(http[s]?://[\S]+|www.[\S]+)");
|
||||
Regex isEmail = new Regex(@"[\S]+@[\S]+");
|
||||
foreach (var item in regx.Split(text))
|
||||
foreach (string item in regx.Split(text))
|
||||
{
|
||||
if (isWWW.IsMatch(item))
|
||||
{
|
||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri(item.ToLower().StartsWith("http") ? item : $"http://{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
||||
Debug.WriteLine(item);
|
||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri(item), Foreground = new SolidColorBrush(Colors.Red) };
|
||||
link.Inlines.Add(new Run { Text = item });
|
||||
block.Inlines.Add(link);
|
||||
}
|
||||
else if (isEmail.IsMatch(item))
|
||||
{
|
||||
Debug.WriteLine(item);
|
||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri($"mailto:{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
||||
link.Inlines.Add(new Run { Text = item });
|
||||
block.Inlines.Add(link);
|
||||
}
|
||||
else if (item == "s")
|
||||
continue;
|
||||
else block.Inlines.Add(new Run { Text = item });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user