File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/Html2OpenXml/Expressions/Numbering Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ public override IEnumerable<OpenXmlElement> Interpret(ParsingContext context)
78
78
{
79
79
var expression = new BlockElementExpression ( liNode ) ;
80
80
var childElements = expression . Interpret ( context ) ;
81
+ if ( ! childElements . Any ( ) ) continue ;
81
82
Paragraph p = ( Paragraph ) childElements . First ( ) ;
82
83
83
84
p . ParagraphProperties ??= new ( ) ;
Original file line number Diff line number Diff line change @@ -131,6 +131,16 @@ public void EmptyList_ShouldBeIgnored()
131
131
}
132
132
}
133
133
134
+ [ Test ( Description = "Empty list item should not be registred" ) ]
135
+ public void EmptyLiElement_ShouldBeIgnored ( )
136
+ {
137
+ var elements = converter . Parse ( @"<ul>
138
+ <li>not empty</li>
139
+ <li></li>
140
+ </ul>" ) ;
141
+ Assert . That ( elements , Has . Count . EqualTo ( 1 ) ) ;
142
+ }
143
+
134
144
[ Test ( Description = "Increment instanceId based on existing lists" ) ]
135
145
public void WithExistingNumbering_ReturnsUniqueInstanceId ( )
136
146
{
You can’t perform that action at this time.
0 commit comments