Handle pulled linebreaks better (fixes #342)

This commit is contained in:
Matt Nadareski
2022-01-01 14:18:14 -08:00
parent 08cc0c394b
commit 1370909db7
2 changed files with 9 additions and 2 deletions

View File

@@ -15,6 +15,7 @@
- Add first attempt 2-layer ringcode guide
- Add even more safety to clone
- Sanitize filename after check
- Handle pulled linebreaks better
### 2.2 (2021-12-30)
- Fix Saturn header finding

View File

@@ -1396,9 +1396,13 @@ namespace MPF.Library
string oldComments = info.CommonDiscInfo.Comments
+ (string.IsNullOrEmpty(info.CommonDiscInfo.Comments) ? string.Empty : "\n")
+ WebUtility.HtmlDecode(match.Groups[1].Value)
.Replace("<br />", "\n")
.Replace("\r\n", "\n")
.Replace("<br />\n", "<br />")
.Replace("<br />", string.Empty)
.Replace("</div>", string.Empty)
.Replace("[+]", string.Empty)
.ReplaceHtmlWithSiteCodes();
oldComments = Regex.Replace(oldComments, @"<div .*?>", string.Empty);
// Create state variables
bool addToLast = false;
@@ -1492,7 +1496,9 @@ namespace MPF.Library
string oldContents = info.CommonDiscInfo.Contents
+ (string.IsNullOrEmpty(info.CommonDiscInfo.Contents) ? string.Empty : "\n")
+ WebUtility.HtmlDecode(match.Groups[1].Value)
.Replace("<br />", "\n")
.Replace("\r\n", "\n")
.Replace("<br />\n", "<br />")
.Replace("<br />", string.Empty)
.Replace("</div>", string.Empty)
.Replace("[+]", string.Empty)
.ReplaceHtmlWithSiteCodes();