mirror of
https://gitlab.com/2009scape/Saradomin-Launcher.git
synced 2026-08-01 14:19:14 -06:00
Merge branch 'newspostParseUpdate' into 'master'
(edgecase) Don't put newlines before text in latest news post, support <strong> as well as <b> See merge request 2009scape/Saradomin-Launcher!50
This commit is contained in:
commit
438c3784b9
1 changed files with 4 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ namespace Saradomin.Utilities
|
|||
public class HtmlRenderer
|
||||
{
|
||||
private int _listDescent = 0;
|
||||
private bool seenNonWhiteSpace = false;
|
||||
|
||||
private Stack<StackPanel> _panels = new();
|
||||
private StackPanel _container;
|
||||
|
|
@ -114,6 +115,8 @@ namespace Saradomin.Utilities
|
|||
var text = HttpUtility.HtmlDecode(
|
||||
htmlNode.GetDirectInnerText().Trim(' ').Trim('\n')
|
||||
);
|
||||
if (!seenNonWhiteSpace && string.IsNullOrWhiteSpace(htmlNode.InnerText)) break;
|
||||
seenNonWhiteSpace = true;
|
||||
|
||||
if (htmlNode.ParentNode.Name == "li")
|
||||
{
|
||||
|
|
@ -126,6 +129,7 @@ namespace Saradomin.Utilities
|
|||
CreateNewInlineTextElement(text);
|
||||
break;
|
||||
|
||||
case "strong":
|
||||
case "b":
|
||||
VisitBold(htmlNode);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue