-
Notifications
You must be signed in to change notification settings - Fork 45
Description
When rendering HTML with handler.SetHtml(), spaces inside nested tags are not displayed.
The following HTML:
<span>This is a<span> </span></span><strong>bold</strong><span><span> </span>text</span>
Sample
` col.Item().HTML(handler => ConfigureHtmlHandler(handler, "This is a bold text"));
private void ConfigureHtmlHandler(HTMLDescriptor handler, string htmlContent)
{
handler.SetTextStyleForHtmlElement("h1", TextStyle.Default.FontSize(16).Bold());
handler.SetTextStyleForHtmlElement("h2", TextStyle.Default.FontSize(14).Bold());
handler.SetTextStyleForHtmlElement("h3", TextStyle.Default.Bold());
handler.SetTextStyleForHtmlElement("h4", TextStyle.Default.Bold());
handler.SetContainerStyleForHtmlElement("ul", c => c.PaddingVertical(10));
handler.SetHtml(htmlContent ?? string.Empty);
}
`
Expected result:
The non-breaking spaces should be preserved and displayed correctly.
Actual result:
The spaces are swallowed and not visible in the final PDF.
Additional info:
QuestPDF version: 2025.7.4
QuestPDF.HTML version: 1.4.2
.NET version: 9.0
Screenshot attached