Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Html2OpenXml/Expressions/PhrasingElementExpression.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) Olivier Nizet https://github.com/onizet/html2openxml - All Rights Reserved
/* Copyright (C) Olivier Nizet https://github.com/onizet/html2openxml - All Rights Reserved
*
* This source is subject to the Microsoft Permissive License.
* Please see the License.txt file for more information.
Expand Down Expand Up @@ -208,7 +208,7 @@ protected static IEnumerable<OpenXmlElement> CombineRuns(IEnumerable<OpenXmlElem
// run can be also a hyperlink
textElement ??= run.GetFirstChild<Run>()?.GetFirstChild<Text>();

if (textElement != null) // could be null when <br/>
if (textElement != null && !string.IsNullOrEmpty(textElement.Text)) // could be null when <br/>
{
var text = textElement.Text;
// we know that the text cannot be empty because we skip them in TextExpression
Expand All @@ -225,4 +225,4 @@ protected static IEnumerable<OpenXmlElement> CombineRuns(IEnumerable<OpenXmlElem
yield return run;
}
}
}
}