Skip to content

Commit

Permalink
popup: Fix handling of align attr in HTML popups
Browse files Browse the repository at this point in the history
- Fix accidentally-inverted condition that caused all align values to be ignored.
- Add "p" to list of tags that can have align attribute.
  • Loading branch information
mstefarov committed Jun 23, 2023
1 parent 46bd607 commit 7d4077d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Toolkit/Toolkit/Internal/HtmlUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ internal static MarkupNode BuildDocumentTree(string snippet)
break;
}

if (name is "div" or "td" or "th" or "tr")
if (name is "div" or "p" or "td" or "th" or "tr")
{
if (!attr.TryGetValue("align", out var alignStr) && Enum.TryParse<HtmlAlignment>(alignStr, true, out var align))
if (attr.TryGetValue("align", out var alignStr) && Enum.TryParse<HtmlAlignment>(alignStr, true, out var align))
newNode.Alignment = align;
}

Expand Down

0 comments on commit 7d4077d

Please sign in to comment.