Skip to content

Commit

Permalink
Another fix to newlines
Browse files Browse the repository at this point in the history
Dismiss now clears pages so a dialog box can be re-used.
fixes #1375
fixes #1370
  • Loading branch information
vchelaru committed Feb 24, 2024
1 parent 1da9380 commit f3304d8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,13 @@ private string[] ConvertToPages(string text)
{
toAppend = BbCodeParser.AddTags(toAppend, foundTagsWithoutNewlines, strippedTextCount);
}

strippedTextCount += sizeBeforeTags;
stringBuilder.Append(toAppend);
if(toAppend?.EndsWith(" ") == true)
{
toAppend = toAppend.Substring(0, toAppend.Length - 1);
}
stringBuilder.Append(toAppend + "\n");
absoluteLineNumber++;
}
pages.Add(stringBuilder.ToString());
Expand Down Expand Up @@ -532,6 +537,7 @@ public void Dismiss()
LastTimeDismissed = TimeManager.CurrentTime;
PageAdvanced?.Invoke(this, null);
FinishedShowing?.Invoke(this, null);
this.Pages.Clear();
IsFocused = false;
}

Expand Down

0 comments on commit f3304d8

Please sign in to comment.