Update notes rendering
This commit is contained in:
@@ -20,8 +20,11 @@
|
||||
|
||||
private static string ConvertUrlsToLinks(string text)
|
||||
{
|
||||
// HTML-encode the text before processing URLs
|
||||
var encodedText = System.Web.HttpUtility.HtmlEncode(text);
|
||||
|
||||
string urlPattern = @"(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})";
|
||||
return Regex.Replace(text, urlPattern, match =>
|
||||
return Regex.Replace(encodedText, urlPattern, match =>
|
||||
{
|
||||
string url = match.Value;
|
||||
if (!url.StartsWith("http://") && !url.StartsWith("https://"))
|
||||
|
||||
Reference in New Issue
Block a user