public override void Close(ParserContext context)
{
base.Close(context);
Tight = true; // tight by default
foreach (var item in Children)
{
// check for non-final list item ending with blank line:
if (item.EndsWithBlankLine && item != LastChild)
{
Tight = false;
break;
}
// recurse into children of list item, to see if there are
// spaces between any of them:
foreach (var subItem in item.Children)
{
if (subItem.EndsWithBlankLine && (item != LastChild || subItem != item.LastChild))
{
Tight = false;
break;
}
}
}
}
}