summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Controllers')
-rw-r--r--src/SMAPI.Web/Controllers/IndexController.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/SMAPI.Web/Controllers/IndexController.cs b/src/SMAPI.Web/Controllers/IndexController.cs
index a24b470c..f4ade7de 100644
--- a/src/SMAPI.Web/Controllers/IndexController.cs
+++ b/src/SMAPI.Web/Controllers/IndexController.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
+using HtmlAgilityPack;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using StardewModdingAPI.Toolkit;
@@ -94,6 +95,19 @@ namespace StardewModdingAPI.Web.Controllers
}
}
+ // strip 'noinclude' blocks from release descriptions
+ foreach (GitRelease release in new[] { stableRelease, betaRelease })
+ {
+ if (release == null)
+ continue;
+
+ HtmlDocument doc = new HtmlDocument();
+ doc.LoadHtml(release.Body);
+ foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//*[@class='noinclude']")?.ToArray() ?? new HtmlNode[0])
+ node.Remove();
+ release.Body = doc.DocumentNode.InnerHtml.Trim();
+ }
+
// get versions
ReleaseVersion[] stableVersions = this.ParseReleaseVersions(stableRelease).ToArray();
ReleaseVersion[] betaVersions = this.ParseReleaseVersions(betaRelease).ToArray();