Browse Source

Fixed: Paragraph spacing was not applied when a span contained only a newline.

Marcin Ziąbek 9 months ago
parent
commit
cb3763e4d3
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Source/QuestPDF/Elements/Text/TextBlock.cs

+ 7 - 0
Source/QuestPDF/Elements/Text/TextBlock.cs

@@ -421,6 +421,13 @@ namespace QuestPDF.Elements.Text
                     continue;
                 }
                 
+                if (textBlockSpan.Text == "\n")
+                {
+                    AddParagraphSpacing();
+                    AddParagraphFirstLineIndentation();
+                    continue;
+                }
+                
                 var textFragments = textBlockSpan.Text.Split('\n');
                     
                 foreach (var textFragment in textFragments)