Browse Source

Fix unnecessary space at the end of the SemanticTag Alt attribute in header content

Marcin Ziąbek 1 month ago
parent
commit
fb51ddae2e
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/QuestPDF/Elements/SemanticTag.cs

+ 4 - 1
Source/QuestPDF/Elements/SemanticTag.cs

@@ -74,7 +74,10 @@ internal class SemanticTag : ContainerElement, ISemanticAware
         {
             if (element is TextBlock textBlock)
             {
-                builder.Append(textBlock.Text).Append(' ');
+                if (builder.Length > 0)
+                    builder.Append(' ');
+                
+                builder.Append(textBlock.Text);
             }
             else if (element is ContainerElement container)
             {