File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/Markdig/Extensions/DefinitionLists Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,20 @@ public override BlockState TryOpen(BlockProcessor processor)
105
105
{
106
106
var index = previousParent . IndexOf ( paragraphBlock ) - 1 ;
107
107
if ( index < 0 ) return null ;
108
- var lastBlock = previousParent [ index ] ;
109
- if ( lastBlock is BlankLineBlock )
108
+ switch ( previousParent [ index ] )
110
109
{
111
- lastBlock = previousParent [ index - 1 ] ;
112
- previousParent . RemoveAt ( index ) ;
110
+ case DefinitionList definitionList :
111
+ return definitionList ;
112
+
113
+ case BlankLineBlock :
114
+ if ( index > 0 && previousParent [ index - 1 ] is DefinitionList definitionList2 )
115
+ {
116
+ previousParent . RemoveAt ( index ) ;
117
+ return definitionList2 ;
118
+ }
119
+ break ;
113
120
}
114
- return lastBlock as DefinitionList ;
121
+ return null ;
115
122
}
116
123
117
124
public override BlockState TryContinue ( BlockProcessor processor , Block block )
You can’t perform that action at this time.
0 commit comments