Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DiscordBot/Services/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using Discord;
Expand Down Expand Up @@ -307,6 +308,11 @@ private async Task UpdateRssFeeds()
else
page.Extract = page.Extract.Replace("\n", Environment.NewLine);

//TODO Not a perfect solution. ``!wiki Quaternion`` and a few other formula pages due to formatting will result a mess without this marked by "displaystyle" currently, so we just sanitize the text if we see that.
// This will also help shrink embeds, but it removes paragraphs as well, making it a wall of text.
if (page.Extract.Contains("displaystyle"))
page.Extract = Regex.Replace(page.Extract, @"\s+", " ");

return (page.Title + ":", page.Extract, page.FullUrl.ToString());
}
}
Expand Down