返回提交历史
Modified
XFENewsApplication/Models/ImageArticlePart.cs
+1
-1
Modified
XFENewsApplication/Utilities/Helper/ArticleDisplayHelper.cs
+3
-0
Modified
XFENewsApplication/Views/NewsViewPage.xaml
+1
-1
Modified
XFENewsApplication/XFENewsApplication.csproj
+0
-1
XFEstudio/XFENewsApplication
移除文章中可能出现的空文本控件
46a910a
代码差异
4 个文件
+5
-3
@@ -1,3 +1,3 @@
1
1
namespace XFENewsApplication.Models;
2
2
3
public class ImageArticlePart : ArticlePart { }
3
public class ImageArticlePart : ArticlePart { }
@@ -1,6 +1,7 @@
1
1
using HtmlAgilityPack;
2
2
using Microsoft.UI.Text;
3
3
using System.Text.Json;
4
using XFEExtension.NetCore.StringExtension;
4
5
using XFENewsApplication.Models;
5
6
6
7
namespace XFENewsApplication.Utilities.Helper;
@@ -31,6 +32,8 @@ public static class ArticleDisplayHelper
31
32
});
32
33
if (node.HasChildNodes)
33
34
continue;
35
if (node.InnerText.IsNullOrWhiteSpace())
36
continue;
34
37
articleParts.Add(new TextArticlePart
35
38
{
36
39
Content = node.InnerText
@@ -15,7 +15,7 @@
15
15
<Page.Resources>
16
16
<converter:URLImageConverter x:Key="URLImageConverter"/>
17
17
<DataTemplate x:Key="TextDataTemplate" x:DataType="model:TextArticlePart">
18
<TextBlock Margin="0,10" Text="{x:Bind Content}" FontSize="{x:Bind FontSize}" FontWeight="{x:Bind FontWeight}" TextWrapping="Wrap"/>
18
<TextBlock Margin="0,10" Text="{x:Bind Content}" FontSize="{x:Bind FontSize}" FontWeight="{x:Bind FontWeight}" TextWrapping="Wrap" IsTextSelectionEnabled="True"/>
19
19
</DataTemplate>
20
20
<DataTemplate x:Key="ImageDataTemplate" x:DataType="model:ImageArticlePart">
21
21
<Image Source="{x:Bind Content, Converter={StaticResource URLImageConverter}}"/>
@@ -98,6 +98,5 @@
98
98
<PropertyGroup>
99
99
<ImplicitUsings>enable</ImplicitUsings>
100
100
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
101
<ApplicationIcon>Assets\icon.png</ApplicationIcon>
102
101
</PropertyGroup>
103
102
</Project>