Skip to content

Commit f672ee4

Browse files
committed
Add html decoding
1 parent 4934364 commit f672ee4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ViewModels/Sources/GenericOnlineSourceViewModel.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using HtmlAgilityPack;
77
using System;
88
using System.Diagnostics;
9+
using System.Net;
910
using System.Threading.Tasks;
1011

1112
namespace COMPASS.ViewModels.Sources
@@ -36,17 +37,17 @@ public override async Task<CodexDto> GetMetaData(SourceSet sources)
3637
CodexDto codex = new();
3738

3839
// Title
39-
codex.Title = src.SelectSingleNode("//meta[@property='og:title']")?.GetAttributeValue("content", null) ?? codex.Title;
40+
codex.Title = WebUtility.HtmlDecode(src.SelectSingleNode("//meta[@property='og:title']")?.GetAttributeValue("content", null) ?? codex.Title);
4041

4142
// Authors
42-
string? author = src.SelectSingleNode("//meta[@property='og:author']")?.GetAttributeValue("content", String.Empty);
43+
string? author = WebUtility.HtmlDecode(src.SelectSingleNode("//meta[@property='og:author']")?.GetAttributeValue("content", String.Empty));
4344
if (!String.IsNullOrEmpty(author))
4445
{
4546
codex.Authors = new() { author };
4647
}
4748

4849
// Description
49-
codex.Description = src.SelectSingleNode("//meta[@property='og:description']")?.GetAttributeValue("content", null) ?? codex.Description;
50+
codex.Description = WebUtility.HtmlDecode(src.SelectSingleNode("//meta[@property='og:description']")?.GetAttributeValue("content", null) ?? codex.Description);
5051

5152
// Tags
5253
foreach (var folderTagPair in TargetCollection.Info.FolderTagPairs)

0 commit comments

Comments
 (0)