Skip to content

Commit

Permalink
修复评论富文本中链接转换错误
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed May 3, 2024
1 parent 7b6485b commit 4738532
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Extensions/DynamicParseExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static RichTextBlock UserDynamicStringToRichText(
}
catch (Exception ex)
{
_logger.Error($"用户动态文本转富文本失败:{id}:", ex);
_logger.Error($"用户动态文本转富文本失败:{id} : {txt}||{input}", ex);
var tx = new RichTextBlock();
var paragraph = new Paragraph();
var run = new Run() { Text = txt };
Expand Down
4 changes: 2 additions & 2 deletions src/BiliLite.UWP/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public static RichTextBlock ToRichTextBlock(this string txt, JObject emote, bool
}
catch (Exception ex)
{
_logger.Error($"富文本转换失败: {txt}", ex);
_logger.Error($"富文本转换失败: {txt} || {input}", ex);
var tx = new RichTextBlock();
Paragraph paragraph = new Paragraph();
Run run = new Run() { Text = txt };
Expand Down Expand Up @@ -387,7 +387,7 @@ private static string HandelVideoID(string input)
List<string> keyword = new List<string>();
List<List<int>> haveHandledOffset = new List<List<int>>();
//如果是链接就不处理了
if (!Regex.IsMatch(input, @"/[aAbBcC][vV]([a-zA-Z0-9]+)"))
if (!Regex.IsMatch(input, @"(?<=://)[^\s]*[aAbBcC][vV]([a-zA-Z0-9]+)"))
{
var offset = 0;

Expand Down

0 comments on commit 4738532

Please sign in to comment.